Revision 05848084
Added by Timo Goebel about 8 years ago
test/factories/host_related.rb | ||
---|---|---|
overrides = {}
|
||
overrides[:locations] = [host.location] unless host.location.nil?
|
||
overrides[:organizations] = [host.organization] unless host.organization.nil?
|
||
host.subnet = FactoryGirl.build(:subnet, overrides)
|
||
host.subnet = FactoryGirl.build(:subnet_ipv4, overrides)
|
||
end
|
||
end
|
||
|
||
... | ... | |
overrides[:locations] = [location] unless location.nil?
|
||
overrides[:organizations] = [organization] unless organization.nil?
|
||
FactoryGirl.create(
|
||
:subnet,
|
||
:subnet_ipv4,
|
||
overrides
|
||
)
|
||
end
|
||
... | ... | |
overrides[:locations] = [location] unless location.nil?
|
||
overrides[:organizations] = [organization] unless organization.nil?
|
||
|
||
FactoryGirl.create(:subnet, overrides)
|
||
FactoryGirl.create(:subnet_ipv4, overrides)
|
||
end
|
||
domain do
|
||
FactoryGirl.create(:domain,
|
||
... | ... | |
end
|
||
|
||
trait :with_tftp_subnet do
|
||
subnet { FactoryGirl.build(:subnet, :tftp, locations: [location], organizations: [organization]) }
|
||
subnet { FactoryGirl.build(:subnet_ipv4, :tftp, locations: [location], organizations: [organization]) }
|
||
end
|
||
|
||
trait :with_tftp_orchestration do
|
||
... | ... | |
end
|
||
|
||
trait :with_subnet do
|
||
subnet
|
||
association :subnet, :factory => :subnet_ipv4
|
||
end
|
||
|
||
trait :with_rootpass do
|
Also available in: Unified diff
fixes #14638 - Refactor Subnet into STI to allow different subnet types