Skip to content

Commit

Permalink
Adjust EmsCommon breadcrumb tests with unified breadrumbs.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Feb 23, 2017
1 parent ff81552 commit 023eeee
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions spec/controllers/ems_infra_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,7 @@
get :show, :params => {:id => @ems.id, :display => 'storages'}
expect(response.status).to eq(200)
expect(response).to render_template('shared/views/ems_common/show')
expect(assigns(:breadcrumbs)).to eq([{:name => "Infrastructure Providers",
:url => "/ems_infra/show_list?page=&refresh=y"},
{:name => "#{@ems.name} (All Managed Datastores)",
:url => "/ems_infra/#{@ems.id}?display=storages"}])
expect(assigns(:breadcrumbs)).to eq([{:name => "#{@ems.name} (All Datastores)", :url => "/ems_infra/#{@ems.id}?display=storages"}])

# display needs to be saved to session for GTL pagination and such
expect(session[:ems_infra_display]).to eq('storages')
Expand All @@ -339,9 +336,7 @@
post :button, :params => {:id => @ems.id, :display => 'storages', :miq_grid_checks => to_cid(datastore.id), :pressed => "storage_tag", :format => :js}
expect(response.status).to eq(200)
_breadcrumbs = controller.instance_variable_get(:@breadcrumbs)
expect(assigns(:breadcrumbs)).to eq([{:name => "Infrastructure Providers",
:url => "/ems_infra/show_list?page=&refresh=y"},
{:name => "#{@ems.name} (All Managed Datastores)",
expect(assigns(:breadcrumbs)).to eq([{:name => "#{@ems.name} (All Datastores)",
:url => "/ems_infra/#{@ems.id}?display=storages"},
{:name => "Tag Assignment", :url => "//tagging_edit"}])
end
Expand Down Expand Up @@ -411,10 +406,7 @@
ems = FactoryGirl.create("ems_vmware")
get :show, :params => { :id => ems.id }
breadcrumbs = controller.instance_variable_get(:@breadcrumbs)
expect(breadcrumbs).to eq([{:name => "Infrastructure Providers",
:url => "/ems_infra/show_list?page=&refresh=y"},
{:name => "#{ems.name} (Dashboard)",
:url => "/ems_infra/#{ems.id}"}])
expect(breadcrumbs).to eq([{:name => "#{ems.name} (Dashboard)", :url => "/ems_infra/#{ems.id}"}])
end
end
end
Expand Down

0 comments on commit 023eeee

Please sign in to comment.