Skip to content

Commit

Permalink
Fix breadcrumb across miq_ae_tools pages
Browse files Browse the repository at this point in the history
https://bugzilla.redhat.com/show_bug.cgi?id=1740761

- One controller with more pages makes problems to menu path
  • Loading branch information
rvsia committed Aug 15, 2019
1 parent 1bc8f66 commit 2401428
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/miq_ae_tools_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,9 @@ def breadcrumbs_options
:breadcrumbs => [
{:title => _("Automation")},
{:title => _("Automate")},
action_name == "resolve" ? {:title => _("Automate")} : nil,
].compact
action_name == "resolve" ? {:title => _("Simulation")} : nil,
].compact,
:hide_title => action_name == "resolve",
}
end

Expand Down
23 changes: 23 additions & 0 deletions spec/controllers/miq_ae_tools_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -545,4 +545,27 @@
end
end
end

describe "breadcrumbs" do
it "shows 'simulation' on resolve screen" do
get :resolve

expect(controller.data_for_breadcrumbs.pluck(:title)[2]).to eq("Simulation")
expect(controller.data_for_breadcrumbs.pluck(:title)[3]).to eq(nil) # no additional title
end

it "shows 'import / export' on import_export screen" do
get :import_export

expect(controller.data_for_breadcrumbs.pluck(:title)[2]).to eq("Import / Export")
expect(controller.data_for_breadcrumbs.pluck(:title)[3]).to eq(nil) # no additional title
end

it "shows 'log' on log screen" do
get :log

expect(controller.data_for_breadcrumbs.pluck(:title)[2]).to eq("Log")
expect(controller.data_for_breadcrumbs.pluck(:title)[3]).to eq(nil) # no additional title
end
end
end

0 comments on commit 2401428

Please sign in to comment.