From 947ce135a9cfe1e5a38b2597300c0b19107ce3fd Mon Sep 17 00:00:00 2001 From: Aparna Karve Date: Wed, 6 Dec 2017 15:45:37 -0800 Subject: [PATCH 1/2] Spec that checks for Generic Object instances in Textual Summary --- spec/controllers/service_controller_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/controllers/service_controller_spec.rb b/spec/controllers/service_controller_spec.rb index 48148884b29..67782714f5a 100644 --- a/spec/controllers/service_controller_spec.rb +++ b/spec/controllers/service_controller_spec.rb @@ -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 From 32d8a1e4794cfe5f10e8c2389e4714b71a6f565e Mon Sep 17 00:00:00 2001 From: Aparna Karve Date: Wed, 6 Dec 2017 15:46:38 -0800 Subject: [PATCH 2/2] Add `generic_objects` in Textual Summary for ServiceAnsiblePlaybook --- app/controllers/service_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/service_controller.rb b/app/controllers/service_controller.rb index 8eddce4ea47..df9ab056f80 100644 --- a/app/controllers/service_controller.rb +++ b/app/controllers/service_controller.rb @@ -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