From 75d671c0b41432ac13e4ff667978eb1a294bee74 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Fri, 6 Oct 2023 11:16:12 +0200 Subject: [PATCH] fix: email no siret service --- lib/tasks/clean_services.rake | 2 +- spec/lib/tasks/clean_services_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/clean_services.rake b/lib/tasks/clean_services.rake index 95d2dfec5..585179818 100644 --- a/lib/tasks/clean_services.rake +++ b/lib/tasks/clean_services.rake @@ -14,7 +14,7 @@ namespace :service do progress = ProgressReport.new(admins.count) admins.each do |admin| - AdministrateurMailer.notify_service_without_siret(admin.email).deliver + AdministrateurMailer.notify_service_without_siret(admin.email).deliver_later progress.inc end end diff --git a/spec/lib/tasks/clean_services_spec.rb b/spec/lib/tasks/clean_services_spec.rb index 7046e6c10..452e658aa 100644 --- a/spec/lib/tasks/clean_services_spec.rb +++ b/spec/lib/tasks/clean_services_spec.rb @@ -36,7 +36,7 @@ describe 'service tasks' do it 'emails admins with published procedures with services without siret' do message = double("message") - allow(message).to receive(:deliver) + allow(message).to receive(:deliver_later) allow(AdministrateurMailer).to receive(:notify_service_without_siret).with(administrateur.email).and_return(message) allow(AdministrateurMailer).to receive(:notify_service_without_siret).with(administrateur_with_siret_service.email).and_return(message)