Merge pull request #10911 from colinux/fix-non-critical-mail-queue

ETQ opérateur, les mails non critiques devraient être envoyés sous ~15min et pas potentiellement des heures
This commit is contained in:
mfo 2024-10-10 15:22:22 +00:00 committed by GitHub
commit a13297f499
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 16 deletions

View file

@ -13,6 +13,6 @@ class PriorizedMailDeliveryJob < ActionMailer::MailDeliveryJob
end
def custom_queue
'low'
'default'
end
end

View file

@ -11,8 +11,8 @@ RSpec.describe AdministrateurMailer, type: :mailer do
it { expect(subject.subject).to include("La suppression automatique des dossiers a été activée sur la démarche") }
context 'when perform_later is called' do
let(:custom_queue) { 'low' }
it 'enqueues email is custom queue for low priority delivery' do
let(:custom_queue) { 'default' }
it 'enqueues email is custom queue for non critical delivery' do
expect { subject.deliver_later }.to have_enqueued_job.on_queue(custom_queue)
end
end
@ -51,8 +51,8 @@ end
it { expect(subject.body).to include("un de vos services n'a pas son siret renseigné") }
context 'when perform_later is called' do
let(:custom_queue) { 'low' }
it 'enqueues email is custom queue for low priority delivery' do
let(:custom_queue) { 'default' }
it 'enqueues email is custom queue for non critical delivery' do
expect { subject.deliver_later }.to have_enqueued_job.on_queue(custom_queue)
end
end

View file

@ -10,9 +10,9 @@ RSpec.describe InstructeurMailer, type: :mailer do
it { expect(subject.body).to include('Bonjour') }
context 'when perform_later is called' do
let(:custom_queue) { 'low' }
let(:custom_queue) { 'default' }
it 'enqueues email is custom queue for low priority delivery' do
it 'enqueues email is custom queue for non critical delivery' do
expect { subject.deliver_later }.to have_enqueued_job(PriorizedMailDeliveryJob).on_queue(custom_queue)
end
end
@ -80,8 +80,8 @@ RSpec.describe InstructeurMailer, type: :mailer do
end
context 'when perform_later is called' do
let(:custom_queue) { 'low' }
it 'enqueues email is custom queue for low priority delivery' do
let(:custom_queue) { 'default' }
it 'enqueues email is custom queue for non critical delivery' do
expect { subject.deliver_later }.to have_enqueued_job.on_queue(custom_queue)
end
end

View file

@ -151,8 +151,8 @@ RSpec.describe UserMailer, type: :mailer do
context 'when perform_later is called' do
let(:role) { administrateurs(:default_admin) }
let(:custom_queue) { 'low' }
it 'enqueues email is custom queue for low priority delivery' do
let(:custom_queue) { 'default' }
it 'enqueues email is custom queue for non critical delivery' do
expect { subject.deliver_later }.to have_enqueued_job.on_queue(custom_queue)
end
end
@ -167,8 +167,8 @@ RSpec.describe UserMailer, type: :mailer do
end
context 'when perform_later is called' do
let(:custom_queue) { 'low' }
it 'enqueues email is custom queue for low priority delivery' do
let(:custom_queue) { 'default' }
it 'enqueues email is custom queue for non critical delivery' do
expect { subject.deliver_later }.to have_enqueued_job.on_queue(custom_queue)
end
end
@ -181,13 +181,13 @@ RSpec.describe UserMailer, type: :mailer do
it 'notifies user about procedure closing with detailed message' do
expect(subject.to).to eq([user.email])
expect(subject.body).to include("Clôture d&#39;une démarche sur demarches-simplifiees.fr")
expect(subject.body).to include("Clôture d&#39;une démarche sur #{APPLICATION_NAME}")
expect(subject.body).to include("Bonjour,\r\n<br />saut de ligne")
end
context 'when perform_later is called' do
let(:custom_queue) { 'low' }
it 'enqueues email is custom queue for low priority delivery' do
let(:custom_queue) { 'default' }
it 'enqueues email is custom queue for non critical delivery' do
expect { subject.deliver_later }.to have_enqueued_job.on_queue(custom_queue)
end
end