Replace Factory.next with FactoryGirl.generate in Getting Started guide

This commit is contained in:
Tom Stuart 2011-08-17 09:27:05 +02:00
parent d56125db95
commit 8af12f0acf
1 changed files with 4 additions and 4 deletions

View File

@ -213,7 +213,7 @@ Sequences
Unique values in a specific format (for example, e-mail addresses) can be
generated using sequences. Sequences are defined by calling sequence in a
definition block, and values in a sequence are generated by calling
Factory.next:
FactoryGirl.generate:
# Defines a new sequence
FactoryGirl.define do
@ -222,10 +222,10 @@ Factory.next:
end
end
Factory.next :email
FactoryGirl.generate :email
# => "person1@example.com"
Factory.next :email
FactoryGirl.generate :email
# => "person2@example.com"
Sequences can be used as attributes:
@ -237,7 +237,7 @@ Sequences can be used as attributes:
Or in lazy attributes:
factory :invite do
invitee { Factory.next(:email) }
invitee { FactoryGirl.generate(:email) }
end
And it's also possible to define an in-line sequence that is only used in