2017-11-21 21:50:03 +00:00
|
|
|
FactoryBot.define do
|
2017-01-27 08:17:03 +00:00
|
|
|
sequence :email do |n|
|
|
|
|
"nicole.braun#{n}@zammad.org"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-11-21 21:50:03 +00:00
|
|
|
FactoryBot.define do
|
2017-01-27 08:17:03 +00:00
|
|
|
|
|
|
|
factory :user do
|
|
|
|
login 'nicole.braun'
|
|
|
|
firstname 'Nicole'
|
|
|
|
lastname 'Braun'
|
|
|
|
email { generate(:email) }
|
2018-03-28 05:33:41 +00:00
|
|
|
password nil
|
2017-01-27 08:17:03 +00:00
|
|
|
active true
|
2017-02-24 17:27:27 +00:00
|
|
|
login_failed 0
|
2017-01-27 08:17:03 +00:00
|
|
|
updated_by_id 1
|
|
|
|
created_by_id 1
|
|
|
|
|
2019-02-04 06:56:18 +00:00
|
|
|
factory :customer_user, aliases: %i[customer] do
|
|
|
|
role_ids { Role.signup_role_ids.sort }
|
2019-02-13 04:19:33 +00:00
|
|
|
|
|
|
|
trait :with_org do
|
|
|
|
organization
|
|
|
|
end
|
2019-02-04 06:56:18 +00:00
|
|
|
end
|
2017-05-02 11:37:20 +00:00
|
|
|
|
2019-02-04 06:56:18 +00:00
|
|
|
factory :agent_user, aliases: %i[agent] do
|
|
|
|
roles { Role.where(name: 'Agent') }
|
|
|
|
end
|
2018-03-08 12:23:37 +00:00
|
|
|
|
2019-02-04 06:56:18 +00:00
|
|
|
factory :admin_user, aliases: %i[admin] do
|
|
|
|
roles { Role.where(name: %w[Admin Agent]) }
|
|
|
|
end
|
2017-02-24 17:27:27 +00:00
|
|
|
end
|
2017-01-27 08:17:03 +00:00
|
|
|
end
|