chore: Ability to Disable Gravatars (#5027)
fixes: #3853 - Introduced DISABLE_GRAVATAR Global Config, which will stop chatwoot from making API requests to gravatar - Cleaned up avatar-related logic and centralized it into the avatarable concern - Added specs for the missing cases - Added migration for existing installations to move the avatar to attachment, rather than making the API that results in 404.
This commit is contained in:
@@ -487,6 +487,14 @@ RSpec.describe 'Contacts API', type: :request do
|
||||
contact.reload
|
||||
expect(contact.avatar.attached?).to be(true)
|
||||
end
|
||||
|
||||
it 'updated avatar with avatar_url' do
|
||||
patch "/api/v1/accounts/#{account.id}/contacts/#{contact.id}",
|
||||
params: valid_params.merge(avatar_url: 'http://example.com/avatar.png'),
|
||||
headers: admin.create_new_auth_token
|
||||
expect(response).to have_http_status(:success)
|
||||
expect(Avatar::AvatarFromUrlJob).to have_been_enqueued.with(contact, 'http://example.com/avatar.png')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user