Skip to content

Commit

Permalink
Merge pull request ManageIQ#12066 from lgalis/ansible_job_template_di…
Browse files Browse the repository at this point in the history
…splay_on_return_to_tab

Ansible Tower Job Template shows the previously selected record on return
  • Loading branch information
mzazrivec committed Oct 21, 2016
2 parents 8e34fd5 + 5059c74 commit 0e7133d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/provider_foreman/explorer.html.haml
Expand Up @@ -15,6 +15,9 @@
- elsif @configured_system_record
#main_div
= render(:partial => 'provider_foreman/main', :locals => {:controller => "provider_foreman"})
- elsif @configuration_script_record
#main_div
= render(:partial => 'provider_foreman/configuration_script', :locals => {:controller => "provider_foreman"})
- else
#main_div
= render(:partial => 'layouts/x_gtl')
Expand Down
26 changes: 26 additions & 0 deletions spec/controllers/provider_foreman_controller_spec.rb
Expand Up @@ -556,6 +556,32 @@
end
end

context "ansible tower job template accordion " do
before do
login_as user_with_feature(%w(providers_accord configured_systems_filter_accord configuration_scripts_accord))
controller.instance_variable_set(:@right_cell_text, nil)
end
render_views

it 'can render details for a job template' do
@record = FactoryGirl.create(:ansible_configuration_script,
:name => "ConfigScript1",
:survey_spec => {'spec' => [{'index' => 0, 'question_description' => 'Survey',
'min' => nil, 'default' => nil, 'max' => nil,
'question_name' => 'Survey', 'required' => false,
'variable' => 'test', 'choices' => nil,
'type' => 'text'}]})
tree_node_id = "cf -" + ApplicationRecord.compress_id(@record.id)
allow(controller).to receive(:x_active_tree).and_return(:configuration_scripts_tree)
allow(controller).to receive(:x_active_accord).and_return(:configuration_scripts)
allow(controller).to receive(:x_node).and_return(tree_node_id)
get :explorer
expect(response.status).to eq(200)
expect(response.body).to include("Question Name")
expect(response.body).to include("Question Description")
end
end

context "fetches the list setting:Grid/Tile/List from settings" do
before do
login_as user_with_feature(%w(providers_accord configured_systems_filter_accord))
Expand Down

0 comments on commit 0e7133d

Please sign in to comment.