Chatwoot/spec/factories/contacts.rb
giquieu 827f977a37
feat: Update API for contact avatar (#4719)
Added the ability to update the contact's avatar via API and Dashboard.

- Contact create and update APIs can now accept avatar attachment parameters [form data].
- Contact create and update endpoints can now accept the avatar_url parameter.[json]
- API endpoint to remove a contact avatar.
- Updated Contact create/edit UI components with avatar support

Fixes: #3428
2022-07-12 10:03:16 +02:00

20 lines
461 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :contact do
sequence(:name) { |n| "Contact #{n}" }
account
trait :with_avatar do
avatar { fixture_file_upload(Rails.root.join('spec/assets/avatar.png'), 'image/png') }
end
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
end
end