Permalink
Browse files

use newer FG syntax in factories defs

  • Loading branch information...
1 parent b3c474f commit f9ce3e5dd82be04471e34c9f49fecdff302de36f @mjankowski mjankowski committed Sep 4, 2011
Showing with 21 additions and 12 deletions.
  1. +21 −12 spec/factories.rb
View
@@ -1,17 +1,26 @@
-Factory.sequence(:age) { |n| n.to_i }
-Factory.sequence(:rating) { |n| n.to_f }
+FactoryGirl.define do
-Factory.define :comment do |f|
- f.association :user
-end
+ sequence :age do |n|
+ n.to_i
+ end
-Factory.define :mammal do |f|
-end
+ sequence :rating do |n|
+ n.to_f
+ end
-Factory.define :post do |f|
-end
+ factory :comment do
+ association :user
+ end
+
+ factory :mammal do
+ end
+
+ factory :post do
+ end
+
+ factory :user do
+ age { Factory.next :age }
+ rating { Factory.next :rating }
+ end
-Factory.define :user do |f|
- f.age { Factory.next :age }
- f.rating { Factory.next :rating }
end

0 comments on commit f9ce3e5

Please sign in to comment.