Skip to content

Instantly share code, notes, and snippets.

@ropiku
Created February 11, 2009 23:12
Show Gist options
  • Save ropiku/62351 to your computer and use it in GitHub Desktop.
Save ropiku/62351 to your computer and use it in GitHub Desktop.
Factory.sequence :email do |n|
"user#{n}@example.com"
end
Factory.sequence :username do |n|
"user#{n}"
end
Factory.define :user do |user|
user.email { Factory.next :email }
user.username { Factory.next :username }
user.password { "password" }
user.password_confirmation { "password" }
end
Factory.define :email_confirmed_user, :class => 'user' do |user|
user.email { Factory.next :email }
user.username { Factory.next :username }
user.password { "password" }
user.password_confirmation { "password" }
user.email_confirmed { true }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment