Sha256: c1a40159b6e6904c164513cd7e244a5f4c89f99bdaa64e8a35afb35b6d526af8

Contents?: true

Size: 668 Bytes

Versions: 7

Compression:

Stored size: 668 Bytes

Contents

FactoryBot.define do
  factory :salt_module, :class => 'ForemanSalt::SaltModule' do
    sequence(:name) { |n| "module#{n}" }
  end

  factory :salt_environment, :class => 'ForemanSalt::SaltEnvironment' do
    sequence(:name) { |n| "environment#{n}" }
  end
end

FactoryBot.modify do
  factory :hostgroup do
    trait :with_salt_modules do
      salt_environment { FactoryBot.build :salt_environment }
      salt_modules { FactoryBot.create_list :salt_module, 10, :salt_environments => [self.salt_environment] }
    end
  end

  factory :smart_proxy do
    trait :with_salt_feature do
      features { [::Feature.find_or_create_by(:name => 'Salt')] }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_salt-13.0.0 test/factories/foreman_salt_factories.rb
foreman_salt-12.0.0 test/factories/foreman_salt_factories.rb
foreman_salt-11.0.1 test/factories/foreman_salt_factories.rb
foreman_salt-11.0.0 test/factories/foreman_salt_factories.rb
foreman_salt-10.3.1 test/factories/foreman_salt_factories.rb
foreman_salt-10.3.0 test/factories/foreman_salt_factories.rb
foreman_salt-10.2.0 test/factories/foreman_salt_factories.rb