Skip to content

Commit

Permalink
Merge pull request #124 from cben/GAPRINDASHVILI-tests-zone
Browse files Browse the repository at this point in the history
[GAPRINDASHVILI] Fix specs failing on a missing zone
  • Loading branch information
simaishi committed Nov 1, 2018
2 parents d6d8754 + 6876d2b commit 3e8ae31
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 8 additions & 0 deletions spec/factories/ext_management_system.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FactoryGirl.define do
factory :ems_openshift_with_zone, :parent => :ems_openshift do
zone do
_guid, _server, zone = EvmSpecHelper.create_guid_miq_server_zone
zone
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
hostname = 'host.example.com'
token = 'theToken'
FactoryGirl.create(
:ems_openshift,
:ems_openshift_with_zone,
:name => 'OpenShiftProvider',
:connection_configurations => [{:endpoint => {:role => :default,
:hostname => hostname,
Expand All @@ -20,10 +20,6 @@
)
end

before(:each) do
allow(MiqServer).to receive(:my_zone).and_return("default")
end

it "instantiate a template with parameters and object labels" do
param = FactoryGirl.create(:container_template_parameter,
:name => 'VAR',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
let(:images_managed_by_openshift_count) { 32 } # only images from /oapi/v1/images

before(:each) do
allow(MiqServer).to receive(:my_zone).and_return("default")
# env vars for easier VCR recording, see test_objects_record.sh
hostname = ENV["OPENSHIFT_MASTER_HOST"] || "host.example.com"
token = ENV["OPENSHIFT_MANAGEMENT_ADMIN_TOKEN"] || "theToken"

@ems = FactoryGirl.create(
:ems_openshift,
:ems_openshift_with_zone,
:name => "OpenShiftProvider",
:connection_configurations => [{:endpoint => {:role => :default,
:hostname => hostname,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# instantiated at the end
shared_examples "openshift refresher VCR targeted refresh tests" do
before(:each) do
allow(MiqServer).to receive(:my_zone).and_return("default")
hostname = 'host.example.com'
token = 'theToken'
hawkular_hostname = 'host.example.com'

@ems = FactoryGirl.create(
:ems_openshift,
:ems_openshift_with_zone,
:name => 'OpenshiftProvider',
:connection_configurations => [{:endpoint => {:role => :default,
:hostname => hostname,
Expand Down

0 comments on commit 3e8ae31

Please sign in to comment.