Skip to content

Commit

Permalink
Merge pull request #20330 from agrare/fix_ems_foreman_specs
Browse files Browse the repository at this point in the history
Fix foreman provider missing url in specs
  • Loading branch information
chessbyte authored Jul 2, 2020
2 parents 3a7421c + c65fdfd commit 4ae9522
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions spec/factories/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
:aliases => ["manageiq/providers/configuration_manager"],
:class => "ManageIQ::Providers::Foreman::ConfigurationManager",
:parent => :ext_management_system do
provider :factory => :provider
provider :factory => :provider_foreman
end

# Automation managers
Expand All @@ -141,7 +141,7 @@
:aliases => ["manageiq/providers/provisioning_manager"],
:class => "ManageIQ::Providers::Foreman::ProvisioningManager",
:parent => :ext_management_system do
provider :factory => :provider
provider :factory => :provider_foreman
end

# Leaf classes for ems_infra
Expand Down
7 changes: 4 additions & 3 deletions spec/models/ext_management_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@
expect { ManageIQ::Providers::AutomationManager.new(:hostname => "abc", :name => "abc", :zone => FactoryBot.build(:zone)).validate! }.to raise_error(ActiveRecord::RecordInvalid)
expect(ManageIQ::Providers::Vmware::InfraManager.new(:hostname => "abc", :name => "abc", :zone => FactoryBot.build(:zone)).validate!).to eq(true)

foreman_provider = ManageIQ::Providers::Foreman::Provider.new
expect(ManageIQ::Providers::Foreman::ConfigurationManager.new(:provider => foreman_provider, :hostname => "abc", :name => "abc", :zone => FactoryBot.build(:zone)).validate!).to eq(true)
expect(ManageIQ::Providers::Foreman::ProvisioningManager.new(:provider => foreman_provider, :hostname => "abc", :name => "abc", :zone => FactoryBot.build(:zone)).validate!).to eq(true)
zone = FactoryBot.create(:zone)
foreman_provider = ManageIQ::Providers::Foreman::Provider.new(:name => "abc", :zone => zone, :url => "https://abc")
expect(ManageIQ::Providers::Foreman::ConfigurationManager.new(:provider => foreman_provider, :name => "abc", :zone => zone).validate!).to eq(true)
expect(ManageIQ::Providers::Foreman::ProvisioningManager.new(:provider => foreman_provider, :name => "abc", :zone => zone).validate!).to eq(true)
end

context "#ipaddress / #ipaddress=" do
Expand Down

0 comments on commit 4ae9522

Please sign in to comment.