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

@@ -23,6 +23,13 @@ RSpec.describe Webhooks::WhatsappEventsJob, type: :job do
expect(Whatsapp::IncomingMessageWhatsappCloudService).to receive(:new)
job.perform_now(params)
end
it 'will not enques Whatsapp::IncomingMessageWhatsappCloudService if channel reauthorization required' do
channel.prompt_reauthorization!
allow(Whatsapp::IncomingMessageWhatsappCloudService).to receive(:new).and_return(process_service)
expect(Whatsapp::IncomingMessageWhatsappCloudService).not_to receive(:new)
job.perform_now(params)
end
end
context 'when default provider' do