chore: Add reauthorization prompt for Whatsapp Channel (#5929)

- Add reauthorization prompt for Whatsapp Channel

fixes: #5782
This commit is contained in:
Sojan Jose
2022-11-24 11:50:32 +00:00
committed by GitHub
parent 606fc9046a
commit 8ea0660862
11 changed files with 148 additions and 7 deletions

View File

@@ -41,4 +41,18 @@ RSpec.describe AdministratorNotifications::ChannelNotificationsMailer, type: :ma
expect(mail.to).to eq([administrator.email])
end
end
describe 'whatsapp_disconnect' do
let!(:whatsapp_channel) { create(:channel_whatsapp, provider: 'whatsapp_cloud', sync_templates: false, validate_provider_config: false) }
let!(:whatsapp_inbox) { create(:inbox, channel: whatsapp_channel, account: account) }
let(:mail) { described_class.with(account: account).whatsapp_disconnect(whatsapp_inbox).deliver_now }
it 'renders the subject' do
expect(mail.subject).to eq('Your Whatsapp connection has expired')
end
it 'renders the receiver email' do
expect(mail.to).to eq([administrator.email])
end
end
end