2019-10-12 18:08:41 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :contact do
|
2020-12-11 17:55:00 +00:00
|
|
|
sequence(:name) { |n| "Contact #{n}" }
|
2019-10-12 18:08:41 +00:00
|
|
|
account
|
2021-09-04 12:26:46 +00:00
|
|
|
|
2022-07-12 08:03:16 +00:00
|
|
|
trait :with_avatar do
|
|
|
|
avatar { fixture_file_upload(Rails.root.join('spec/assets/avatar.png'), 'image/png') }
|
|
|
|
end
|
|
|
|
|
2021-09-04 12:26:46 +00:00
|
|
|
trait :with_email do
|
|
|
|
sequence(:email) { |n| "contact-#{n}@example.com" }
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :with_phone_number do
|
|
|
|
phone_number { Faker::PhoneNumber.cell_phone_in_e164 }
|
|
|
|
end
|
2019-10-12 18:08:41 +00:00
|
|
|
end
|
|
|
|
end
|