Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract factories to provider gems #11413

Merged
merged 2 commits into from
Sep 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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