Skip to content

Commit

Permalink
Merge pull request #47 from djberg96/factory_bot
Browse files Browse the repository at this point in the history
Change FactoryGirl to FactoryBot
  • Loading branch information
agrare authored Jan 8, 2019
2 parents e3e57d3 + 4686304 commit 0c67b47
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions spec/factories/ext_management_system.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FactoryGirl.define do
FactoryBot.define do
factory :ems_redfish_physical_infra,
:aliases => ["manageiq/providers/redfish/physical_infra"],
:class => "ManageIQ::Providers::Redfish::PhysicalInfraManager",
:parent => :ems_physical_infra do
trait :auth do
after(:create) do |ems|
ems.authentications << FactoryGirl.create(:authentication)
ems.authentications << FactoryBot.create(:authentication)
end
end

Expand All @@ -20,7 +20,7 @@

after(:create) do |ems|
secrets = Rails.application.secrets.redfish
ems.authentications << FactoryGirl.create(
ems.authentications << FactoryBot.create(
:authentication,
:userid => secrets.try(:[], "userid") || "REDFISH_USERID",
:password => secrets.try(:[], "password") || "REDFISH_PASSWORD"
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/physical_server.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :redfish_physical_server,
:class => "ManageIQ::Providers::Redfish::PhysicalInfraManager::PhysicalServer",
:parent => :physical_server do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe ManageIQ::Providers::Redfish::PhysicalInfraManager do
let(:server) { FactoryGirl.create(:redfish_physical_server, :vcr) }
let(:server) { FactoryBot.create(:redfish_physical_server, :vcr) }
subject(:ems) do
FactoryGirl.create(:ems_redfish_physical_infra, :vcr)
FactoryBot.create(:ems_redfish_physical_infra, :vcr)
end

describe "#blink_loc_led", :vcr do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe ManageIQ::Providers::Redfish::PhysicalInfraManager do
let(:server) { FactoryGirl.create(:redfish_physical_server, :vcr) }
let(:server) { FactoryBot.create(:redfish_physical_server, :vcr) }
subject(:ems) do
FactoryGirl.create(:ems_redfish_physical_infra, :vcr)
FactoryBot.create(:ems_redfish_physical_infra, :vcr)
end

describe "#power_on", :vcr do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe ManageIQ::Providers::Redfish::PhysicalInfraManager::Refresher do
subject(:ems) do
FactoryGirl.create(:ems_redfish_physical_infra, :vcr,
FactoryBot.create(:ems_redfish_physical_infra, :vcr,
:security_protocol => "ssl",
:port => 8889)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let(:rf_module) { class_double("RedfishClient").as_stubbed_const }
let(:rf_client) { instance_double("RedfishClient::Root") }
subject(:ems) do
FactoryGirl.create(:ems_redfish_physical_infra, :auth,
FactoryBot.create(:ems_redfish_physical_infra, :auth,
:hostname => "host",
:port => 1234)
end
Expand Down Expand Up @@ -44,7 +44,7 @@

context "#connect" do
it "aborts on missing credentials" do
ems = FactoryGirl.create(:ems_redfish_physical_infra)
ems = FactoryBot.create(:ems_redfish_physical_infra)
expect { ems.connect }.to raise_error(MiqException::MiqHostError)
end

Expand Down

0 comments on commit 0c67b47

Please sign in to comment.