Skip to content

Commit

Permalink
@layout should be 'miq_vm_request' in order for the submenu to render
Browse files Browse the repository at this point in the history
  • Loading branch information
AparnaKarve committed Sep 28, 2015
1 parent 966baee commit ad0b7d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Expand Up @@ -494,7 +494,6 @@ def dialog_partial_for_workflow
def layout_from_tab_name(tab_name)
case tab_name
when "ae" then "miq_request_ae"
when "configured_system" then "miq_request_configured_system"
when "host" then "miq_request_host"
else "miq_request_vm" # Includes "vm"
end
Expand Down
17 changes: 17 additions & 0 deletions spec/controllers/miq_request_controller_spec.rb
Expand Up @@ -143,4 +143,21 @@
expect(response.body).to_not be_empty
end
end

context "#layout_from_tab_name" do
before do
set_user_privileges
FactoryGirl.create(:vmdb_database)
EvmSpecHelper.create_guid_miq_server_zone
session[:settings] = {:display => {:quad_truncate => 'f'},
:quadicons => {:host => 'foo'},
:views => {:miq_request => 'grid'}}
end

it "miq_request/show_list sets @layout='miq_request_vm' when redirected via foreman provisioning" do
post :show_list, :typ => "configured_systems"
layout = controller.instance_variable_get(:@layout)
expect(layout).to eq("miq_request_vm")
end
end
end

0 comments on commit ad0b7d0

Please sign in to comment.