From 7fe502ca6bc08238d92a2040385445523de8c58b Mon Sep 17 00:00:00 2001 From: Martin Povolny Date: Tue, 14 Mar 2017 21:56:39 +0100 Subject: [PATCH 1/2] Fix middleware nested lists. --- app/controllers/middleware_domain_controller.rb | 2 +- app/controllers/middleware_server_controller.rb | 2 +- app/controllers/middleware_server_group_controller.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/middleware_domain_controller.rb b/app/controllers/middleware_domain_controller.rb index 989f46ffbe1..9ee25c0fb05 100644 --- a/app/controllers/middleware_domain_controller.rb +++ b/app/controllers/middleware_domain_controller.rb @@ -10,7 +10,7 @@ class MiddlewareDomainController < ApplicationController after_action :set_session_data def self.display_methods - %i(middleware_server_groups) + %w(middleware_server_groups) end menu_section :cnt diff --git a/app/controllers/middleware_server_controller.rb b/app/controllers/middleware_server_controller.rb index f9fd1592750..3d18f9f114e 100644 --- a/app/controllers/middleware_server_controller.rb +++ b/app/controllers/middleware_server_controller.rb @@ -159,7 +159,7 @@ def add_datasource end def self.display_methods - %i(middleware_datasources middleware_deployments middleware_messagings) + %w(middleware_datasources middleware_deployments middleware_messagings) end def button diff --git a/app/controllers/middleware_server_group_controller.rb b/app/controllers/middleware_server_group_controller.rb index 36feb6f460a..dc8341e0e92 100644 --- a/app/controllers/middleware_server_group_controller.rb +++ b/app/controllers/middleware_server_group_controller.rb @@ -35,7 +35,7 @@ def self.operations end def self.display_methods - %i(middleware_servers) + %w(middleware_servers) end def textual_group_list From a623717b35acdcd9256852b35ac32ae5b5942d2b Mon Sep 17 00:00:00 2001 From: Martin Povolny Date: Tue, 14 Mar 2017 21:58:26 +0100 Subject: [PATCH 2/2] Add a sample nested list test for MiddlewareServerController. --- .../middleware_server_controller_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/controllers/middleware_server_controller_spec.rb b/spec/controllers/middleware_server_controller_spec.rb index fdc4c88b81e..b6c95d86672 100644 --- a/spec/controllers/middleware_server_controller_spec.rb +++ b/spec/controllers/middleware_server_controller_spec.rb @@ -30,4 +30,18 @@ end end end + + # FIXME: should test for nested entities: %w(middleware_datasources middleware_deployments middleware_messagings) + describe '#show' do + before do + EvmSpecHelper.create_guid_miq_server_zone + end + + let(:server) { FactoryGirl.create(:middleware_server) } + let(:deployment) { FactoryGirl.create(:middleware_deployment, :middleware_server => server) } + + it "show associated server groups" do + assert_nested_list(server, [deployment], 'middleware_deployments', 'All Middleware Deployments') + end + end end