Skip to content

Commit

Permalink
Merge pull request #11413 from durandom/extract_factories
Browse files Browse the repository at this point in the history
Extract factories to provider gems
(cherry picked from commit 0aa3437)
  • Loading branch information
blomquisg authored and chessbyte committed Sep 29, 2016
1 parent a155382 commit 598289d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions spec/factories/floating_ip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
sequence(:address) { |n| ip_from_seq(n) }
end

factory :floating_ip_amazon, :parent => :floating_ip,
:class => "ManageIQ::Providers::Amazon::NetworkManager::FloatingIp"
factory :floating_ip_azure, :parent => :floating_ip,
:class => "ManageIQ::Providers::Azure::NetworkManager::FloatingIp"
factory :floating_ip_openstack, :parent => :floating_ip,
Expand Down
4 changes: 4 additions & 0 deletions spec/support/factory_girl_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ def seq_padded_for_sorting(n)
require 'factory_girl'
# in case we are running as an engine, the factories are located in the dummy app
FactoryGirl.definition_file_paths << 'spec/manageiq/spec/factories'
# also add factories from provider gems until miq codebase does not use any provider specific factories anymore
Rails::Engine.subclasses.select { |e| e.name.starts_with?("ManageIQ::Providers") }.each do |engine|
FactoryGirl.definition_file_paths << File.join(engine.root, 'spec', 'factories')
end
FactoryGirl.find_definitions

0 comments on commit 598289d

Please sign in to comment.