Created
May 25, 2012 04:40
-
-
Save apraditya/2785803 to your computer and use it in GitHub Desktop.
factory definition
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.define :user do |u| | |
u.password 'password' | |
u.password_confirmation { |u| u.password } | |
u.confirmation_sent_at Time.new | |
u.confirmed_at Time.new | |
u.location 'US' | |
end | |
Factory.define :admin, :parent => :user do |admin| | |
admin.sequence(:name) { |n| "Admin #{n}" } | |
admin.sequence(:email) { |n| "admin.#{n}@email.com" } | |
admin.role 'admin' | |
end | |
Factory.define :member, :parent => :user do |member| | |
member.sequence(:name) { |n| "Member #{n}" } | |
member.sequence(:email) { |n| "member.#{n}@email.com" } | |
member.role 'member' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment