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:
@@ -13,7 +13,7 @@ describe ::ContactIdentifyAction do
|
||||
|
||||
describe '#perform' do
|
||||
it 'updates the contact' do
|
||||
expect(ContactAvatarJob).not_to receive(:perform_later).with(contact, params[:avatar_url])
|
||||
expect(Avatar::AvatarFromUrlJob).not_to receive(:perform_later).with(contact, params[:avatar_url])
|
||||
contact_identify
|
||||
expect(contact.reload.name).to eq 'test'
|
||||
# custom attributes are merged properly without overwriting existing ones
|
||||
@@ -32,7 +32,7 @@ describe ::ContactIdentifyAction do
|
||||
|
||||
it 'enques avatar job when avatar url parameter is passed' do
|
||||
params = { name: 'test', avatar_url: 'https://chatwoot-assets.local/sample.png' }
|
||||
expect(ContactAvatarJob).to receive(:perform_later).with(contact, params[:avatar_url]).once
|
||||
expect(Avatar::AvatarFromUrlJob).to receive(:perform_later).with(contact, params[:avatar_url]).once
|
||||
described_class.new(contact: contact, params: params).perform
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user