Skip to content

Commit

Permalink
Merge pull request #2974 from AparnaKarve/bz1496984_display_go_for_al…
Browse files Browse the repository at this point in the history
…l_services

Display Generic Object instances for Ansible Playbook Services as well
  • Loading branch information
mzazrivec authored Dec 7, 2017
2 parents 7dc40e6 + 32d8a1e commit 08f1d23
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/service_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def sanitize_output(stdout)

def textual_group_list
if @record.type == "ServiceAnsiblePlaybook"
[%i(properties), %i(lifecycle tags)]
[%i(properties), %i(lifecycle tags generic_objects)]
else
[%i(properties lifecycle relationships generic_objects miq_custom_attributes), %i(vm_totals tags)]
end
Expand Down
14 changes: 14 additions & 0 deletions spec/controllers/service_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,19 @@
end
end

context "Generic Object instances in Textual Summary" do
it "displays Generic Objects in Ansible Playbook Service Textual Summary" do
record = FactoryGirl.create(:service_ansible_playbook)
controller.instance_variable_set(:@record, record)
expect(controller.send(:textual_group_list)).to include(array_including(:generic_objects))
end

it "displays Generic Objects for all other Services" do
record = FactoryGirl.create(:service)
controller.instance_variable_set(:@record, record)
expect(controller.send(:textual_group_list)).to include(array_including(:generic_objects))
end
end

it_behaves_like "explorer controller with custom buttons"
end

0 comments on commit 08f1d23

Please sign in to comment.