Skip to content

Commit

Permalink
Added provider and interface factory
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Pavano committed Aug 26, 2011
1 parent efa0b5f commit 9c1e377
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/factories.rb
Expand Up @@ -23,4 +23,23 @@

Factory.define :provider_group do |f|
f.sequence(:name) {|n| "Test Provider Group #{n}" }
f.after_build do |u|
Factory.create(:provider, :provider_group => u)
end
end

Factory.define :provider do |f|
f.association :provider_group
f.association :interface
f.sequence(:name) { |n| "Test Provider#{n}" }
f.rate_down 10000000000
f.rate_up 10000000000
f.sequence(:ip) { |n| "192.168.0.#{n}" }
f.kind 'static'
f.netmask '255.255.255.0'
f.gateway '192.168.0.254'
end

Factory.define :interface do |f|
f.sequence(:name) { |n| 'eth' + n.to_s }
end

0 comments on commit 9c1e377

Please sign in to comment.