2023-02-21 19:55:31 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-03-12 20:47:22 +01:00
|
|
|
Fabricator(:user) do
|
2024-05-31 05:54:11 -04:00
|
|
|
account do |attrs|
|
|
|
|
Fabricate.build(
|
|
|
|
:account,
|
|
|
|
attrs.fetch(:account_attributes, {}).merge(user: nil)
|
|
|
|
)
|
|
|
|
end
|
2017-05-20 17:09:40 +02:00
|
|
|
email { sequence(:email) { |i| "#{i}#{Faker::Internet.email}" } }
|
2023-02-18 17:38:14 -05:00
|
|
|
password '123456789'
|
2018-10-08 13:50:11 +11:00
|
|
|
confirmed_at { Time.zone.now }
|
2023-03-02 10:05:05 +01:00
|
|
|
current_sign_in_at { Time.zone.now }
|
|
|
|
agreement true
|
2016-03-12 20:47:22 +01:00
|
|
|
end
|
2025-01-03 03:28:14 -05:00
|
|
|
|
|
|
|
Fabricator(:admin_user, from: :user) do
|
|
|
|
role UserRole.find_by(name: 'Admin')
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:moderator_user, from: :user) do
|
|
|
|
role UserRole.find_by(name: 'Moderator')
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:owner_user, from: :user) do
|
|
|
|
role UserRole.find_by(name: 'Owner')
|
|
|
|
end
|