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

Add several ext_management_system factories #14017

Merged
merged 1 commit into from
Feb 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions spec/factories/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@
guid { MiqUUID.new_guid }
zone { Zone.first || FactoryGirl.create(:zone) }
storage_profiles { [] }

# Traits

trait :with_clusters do
transient do
cluster_count 3
end

after :create do |ems, evaluator|
create_list :ems_cluster, evaluator.cluster_count, :ext_management_system => ems
end
end

trait :with_storages do
transient do
storage_count 3
end

after :create do |ems, evaluator|
create_list :storage, evaluator.storage_count, :ext_management_system => ems
end
end
end

# Intermediate classes
Expand Down Expand Up @@ -136,6 +158,16 @@
:parent => :ems_infra do
end

factory :ems_redhat_v3,
:parent => :ems_redhat do
api_version '3.5'
end

factory :ems_redhat_v4,
:parent => :ems_redhat do
api_version '4.0'
end

factory :ems_redhat_with_authentication,
:parent => :ems_redhat do
after(:create) do |x|
Expand Down