have to explicitly require factory girl

This commit is contained in:
Joe Sak 2011-04-22 15:59:24 -05:00
parent fe3bb08fcf
commit 7746f86dbf
3 changed files with 6 additions and 4 deletions

View file

@ -1,3 +1,5 @@
require 'factory_girl'
Factory.define(:blog_category) do |f|
f.sequence(:title) { |n| "Shopping #{n}" }
end

View file

@ -1,10 +1,8 @@
Factory.sequence :email do |n|
"person#{n}@example.com"
end
require 'factory_girl'
Factory.define(:blog_comment) do |f|
f.name "Joe Commenter"
f.email { Factory.next(:email) }
f.sequence(:email) { |n| "person#{n}@example.com" }
f.body "Which one is the best for picking up new shoes?"
f.association :post
end

View file

@ -1,3 +1,5 @@
require 'factory_girl'
Factory.define(:post, :class => BlogPost) 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."