2019-10-12 18:08:41 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :user do
|
2019-10-14 08:54:58 +00:00
|
|
|
transient do
|
|
|
|
skip_confirmation { true }
|
|
|
|
end
|
|
|
|
|
2019-10-12 18:08:41 +00:00
|
|
|
provider { 'email' }
|
|
|
|
uid { SecureRandom.uuid }
|
2019-10-16 21:48:07 +00:00
|
|
|
name { Faker::Name.name }
|
2019-10-20 08:47:26 +00:00
|
|
|
nickname { Faker::Name.first_name }
|
2019-10-14 08:54:58 +00:00
|
|
|
email { nickname + '@example.com' }
|
2019-10-12 18:08:41 +00:00
|
|
|
role { 'agent' }
|
2019-10-20 08:47:26 +00:00
|
|
|
password { 'password' }
|
2019-10-12 18:08:41 +00:00
|
|
|
account
|
2019-10-14 08:54:58 +00:00
|
|
|
|
|
|
|
after(:build) do |user, evaluator|
|
|
|
|
user.skip_confirmation! if evaluator.skip_confirmation
|
|
|
|
end
|
2019-10-12 18:08:41 +00:00
|
|
|
end
|
|
|
|
end
|