From db36fc971dd4f0fc2775bd73f0c01325cf9530b6 Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Wed, 14 Jun 2017 12:55:14 +0000 Subject: [PATCH] Fix middleware spec failures on master One failure happens because accessing `feed` on a hawkular MiddlewareServer fails when `feed` is `nil`. The other happens because now a hawkular now only finds hawkular datasources, not generic MiddlewareDatasource. --- spec/controllers/middleware_server_controller_spec.rb | 6 +++++- .../middleware_server_group_controller_spec.rb | 10 ++++++++-- spec/helpers/application_helper_spec.rb | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/spec/controllers/middleware_server_controller_spec.rb b/spec/controllers/middleware_server_controller_spec.rb index 0185cbc3a58..6ab869d4be1 100644 --- a/spec/controllers/middleware_server_controller_spec.rb +++ b/spec/controllers/middleware_server_controller_spec.rb @@ -1,5 +1,9 @@ describe MiddlewareServerController do - let(:server) { FactoryGirl.create(:hawkular_middleware_server, :properties => {}, :middleware_server_group => nil) } + let(:server) do + FactoryGirl.create(:hawkular_middleware_server, :properties => {}, + :middleware_server_group => nil, + :feed => '') + end render_views before(:each) do diff --git a/spec/controllers/middleware_server_group_controller_spec.rb b/spec/controllers/middleware_server_group_controller_spec.rb index 06912ee5c1c..3bce7310423 100644 --- a/spec/controllers/middleware_server_group_controller_spec.rb +++ b/spec/controllers/middleware_server_group_controller_spec.rb @@ -11,11 +11,17 @@ end describe '#show' do - let(:group) { FactoryGirl.create(:hawkular_middleware_server_group, :properties => {}, :middleware_domain => nil) } + let(:group) do + FactoryGirl.create(:hawkular_middleware_server_group, :properties => {}, + :middleware_domain => nil) + end + let(:server) do FactoryGirl.create(:hawkular_middleware_server, :properties => {}, - :middleware_server_group => group) + :middleware_server_group => group, + :feed => '') end + before do EvmSpecHelper.create_guid_miq_server_zone login_as FactoryGirl.create(:user) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 279cb0fbf7a..900fe59b828 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -1298,7 +1298,7 @@ stub_user(:features => :all) allow(helper).to receive_messages(:controller_name => "ems_middleware") ems = FactoryGirl.create(:ems_hawkular) - MiddlewareDatasource.create(:ext_management_system => ems, :name => "Test Middleware") + FactoryGirl.create(:hawkular_middleware_datasource, :ext_management_system => ems, :name => "Test Middleware") expect(helper.multiple_relationship_link(ems, "middleware_datasource")).to eq("
  • Middleware Datasources (1)
  • ") end