Sha256: 5a48386548e1adc5ad66a255d098c459ddf058b7182e7679b06502352bbf9f93

Contents?: true

Size: 923 Bytes

Versions: 15

Compression:

Stored size: 923 Bytes

Contents

FactoryGirl.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

FactoryGirl.modify do
  factory :host do
    trait :with_salt_proxy do
      salt_proxy { FactoryGirl.build :smart_proxy, :with_salt_feature }
    end
  end

  factory :hostgroup do
    trait :with_salt_proxy do
      salt_proxy { FactoryGirl.build :smart_proxy, :with_salt_feature }
    end

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

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
foreman_salt-8.0.4 test/factories/foreman_salt_factories.rb
foreman_salt-9.0.1 test/factories/foreman_salt_factories.rb
foreman_salt-9.0.0 test/factories/foreman_salt_factories.rb
foreman_salt-8.0.3 test/factories/foreman_salt_factories.rb
foreman_salt-8.0.2 test/factories/foreman_salt_factories.rb
foreman_salt-8.0.1 test/factories/foreman_salt_factories.rb
foreman_salt-7.0.3 test/factories/foreman_salt_factories.rb
foreman_salt-8.0.0 test/factories/foreman_salt_factories.rb
foreman_salt-7.0.2 test/factories/foreman_salt_factories.rb
foreman_salt-6.0.1 test/factories/foreman_salt_factories.rb
foreman_salt-7.0.1 test/factories/foreman_salt_factories.rb
foreman_salt-7.0.0 test/factories/foreman_salt_factories.rb
foreman_salt-6.0.0 test/factories/foreman_salt_factories.rb
foreman_salt-5.0.1 test/factories/foreman_salt_factories.rb
foreman_salt-5.0.0 test/factories/foreman_salt_factories.rb