Created
September 18, 2012 19:12
-
-
Save jnwheeler44/3745167 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Factory.sequence :email do |n| | |
"test#{n}@example.com" | |
end | |
Factory.sequence :username do |n| | |
"user#{n}" | |
end | |
Factory.sequence :visitor_token do |n| | |
"token#{n}" | |
end | |
Factory.define :user do |u| | |
u.email { Factory.next(:email) } | |
u.visitor_token { Factory.next(:visitor_token) } | |
u.password "secret" | |
u.password_confirmation {|u| u.password } | |
end | |
Factory.define :active_user, :parent => :user do |u| | |
u.after_build do |u| | |
u.confirm! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment