Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Generic Object instances for Ansible Playbook Services as well #2974

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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