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-14 08:54:58 +00:00
|
|
|
name { FFaker::Name.name }
|
|
|
|
nickname { FFaker::InternetSE.user_name_from_name(name) }
|
|
|
|
email { nickname + '@example.com' }
|
2019-10-12 18:08:41 +00:00
|
|
|
role { 'agent' }
|
|
|
|
password { "password" }
|
|
|
|
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
|