diff options
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/blog_categories.rb | 6 | ||||
-rw-r--r-- | spec/factories/blog_comments.rb | 12 | ||||
-rw-r--r-- | spec/factories/blog_posts.rb | 14 |
3 files changed, 19 insertions, 13 deletions
diff --git a/spec/factories/blog_categories.rb b/spec/factories/blog_categories.rb index c3701dd..31ec28b 100644 --- a/spec/factories/blog_categories.rb +++ b/spec/factories/blog_categories.rb @@ -1,3 +1,5 @@ -Factory.define :blog_category, :class => 'refinery/blog_category' do |f| - f.sequence(:title) { |n| "Shopping #{n}" } +FactoryGirl.define do + factory :blog_category, :class => 'refinery/blog_category' do + sequence(:title) { |n| "Shopping #{n}" } + end end diff --git a/spec/factories/blog_comments.rb b/spec/factories/blog_comments.rb index d738cac..0bb5206 100644 --- a/spec/factories/blog_comments.rb +++ b/spec/factories/blog_comments.rb @@ -1,6 +1,8 @@ -Factory.define :blog_comment, :class => 'refinery/blog_comment' do |f| - f.name "Joe Commenter" - f.sequence(:email) { |n| "person#{n}@example.com" } - f.body "Which one is the best for picking up new shoes?" - f.association :post, :factory => :blog_post +FactoryGirl.define do + factory :blog_comment, :class => 'refinery/blog_comment' do + name "Joe Commenter" + sequence(:email) { |n| "person#{n}@example.com" } + body "Which one is the best for picking up new shoes?" + association :post, :factory => :blog_post + end end diff --git a/spec/factories/blog_posts.rb b/spec/factories/blog_posts.rb index 548636d..4586b36 100644 --- a/spec/factories/blog_posts.rb +++ b/spec/factories/blog_posts.rb @@ -1,7 +1,9 @@ -Factory.define :blog_post, :class => 'refinery/blog_post' do |f| - f.sequence(:title) { |n| "Top #{n} Shopping Centers in Chicago" } - f.body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it." - f.draft false - f.tag_list "chicago, shopping, fun times" - f.published_at Time.now +FactoryGirl.define do + factory :blog_post, :class => 'refinery/blog_post' do + sequence(:title) { |n| "Top #{n} Shopping Centers in Chicago" } + body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it." + draft false + tag_list "chicago, shopping, fun times" + published_at Time.now + end end |