summaryrefslogtreecommitdiff
path: root/test/factories/phones.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 22:17:32 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 22:17:32 +0100
commitaf79440bd75d2cffb2eb0ba43b5cfe918a78162c (patch)
treefd6c4dab5dc56fed5f616ddec20e1f82780f20fe /test/factories/phones.rb
parent648f51a0ac97675d6cdf6a4b0c3c75bc9ea23168 (diff)
parent9f14a9a6573db607b79124524088803812454515 (diff)
Merge branch 'rename_factory_class' into develop
Conflicts: Gemfile.lock
Diffstat (limited to 'test/factories/phones.rb')
-rw-r--r--test/factories/phones.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/factories/phones.rb b/test/factories/phones.rb
index 646d548..af0b37a 100644
--- a/test/factories/phones.rb
+++ b/test/factories/phones.rb
@@ -1,15 +1,17 @@
# Read about factories at http://github.com/thoughtbot/factory_girl
-Factory.define :phone do |f|
- f.sequence(:mac_address) { |n| ('%06d' % n).to_s + ('%06d' % n).to_s }
- f.association :phone_model
- f.association :phoneable, :factory => :tenant
+FactoryGirl.define do
+ factory :phone do |f|
+ f.sequence(:mac_address) { |n| ('%06d' % n).to_s + ('%06d' % n).to_s }
+ f.association :phone_model
+ f.association :phoneable, :factory => :tenant
- # We have to make sure that the OUI is created as well.
- f.after_build do |instance|
- Factory.create(:oui,
- :manufacturer => instance.phone_model.manufacturer,
- :value => instance.mac_address.slice(0, 6)
- )
+ # We have to make sure that the OUI is created as well.
+ f.after_build do |instance|
+ FactoryGirl.create(:oui,
+ :manufacturer => instance.phone_model.manufacturer,
+ :value => instance.mac_address.slice(0, 6)
+ )
+ end
end
end \ No newline at end of file