2014-04-09 01:32:47 +02:00
|
|
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
|
|
|
|
|
|
|
|
|
FactoryGirl.define do
|
|
|
|
|
factory :user do
|
2014-05-12 14:19:46 +05:30
|
|
|
sequence(:email) {|n|'name#{n}@example.com'}
|
2014-04-09 01:32:47 +02:00
|
|
|
password 'changeme'
|
|
|
|
|
password_confirmation 'changeme'
|
|
|
|
|
confirmed_at Time.now
|
|
|
|
|
end
|
2014-05-12 17:53:11 +05:30
|
|
|
factory :admin, class: User do
|
|
|
|
|
sequence(:email) {|n|'gopesh#{n}@exampleco.in'}
|
|
|
|
|
password 'changeme'
|
|
|
|
|
password_confirmation 'changeme'
|
|
|
|
|
confirmed_at Time.now
|
|
|
|
|
after(:create) { |user| user.role_ids = [3] }
|
|
|
|
|
end
|
2014-04-09 01:32:47 +02:00
|
|
|
end
|