Merge pull request #5171 from betagouv/fix-expired-dossiers-deletion
dossiers expiration: fix the mailer arguments
This commit is contained in:
commit
6ccb09a9e3
2 changed files with 10 additions and 10 deletions
|
@ -117,14 +117,14 @@ class ExpiredDossiersDeletionService
|
||||||
.group_by(&:user)
|
.group_by(&:user)
|
||||||
.each do |(user, dossiers)|
|
.each do |(user, dossiers)|
|
||||||
DossierMailer.notify_automatic_deletion_to_user(
|
DossierMailer.notify_automatic_deletion_to_user(
|
||||||
DeletedDossier.where(dossier_id: dossiers.map(&:id)),
|
DeletedDossier.where(dossier_id: dossiers.map(&:id)).to_a,
|
||||||
user.email
|
user.email
|
||||||
).deliver_later
|
).deliver_later
|
||||||
end
|
end
|
||||||
|
|
||||||
self.group_by_fonctionnaire_email(dossiers_to_remove).each do |(email, dossiers)|
|
self.group_by_fonctionnaire_email(dossiers_to_remove).each do |(email, dossiers)|
|
||||||
DossierMailer.notify_automatic_deletion_to_administration(
|
DossierMailer.notify_automatic_deletion_to_administration(
|
||||||
DeletedDossier.where(dossier_id: dossiers.map(&:id)),
|
DeletedDossier.where(dossier_id: dossiers.map(&:id)).to_a,
|
||||||
email
|
email
|
||||||
).deliver_later
|
).deliver_later
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ describe ExpiredDossiersDeletionService do
|
||||||
let!(:valid_brouillon) { create(:dossier, procedure: procedure, created_at: date_not_expired) }
|
let!(:valid_brouillon) { create(:dossier, procedure: procedure, created_at: date_not_expired) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow(DossierMailer).to receive(:notify_brouillon_near_deletion).and_return(double(deliver_later: nil))
|
allow(DossierMailer).to receive(:notify_brouillon_near_deletion).and_call_original
|
||||||
allow(DossierMailer).to receive(:notify_brouillon_deletion).and_return(double(deliver_later: nil))
|
allow(DossierMailer).to receive(:notify_brouillon_deletion).and_call_original
|
||||||
|
|
||||||
ExpiredDossiersDeletionService.process_expired_dossiers_brouillon
|
ExpiredDossiersDeletionService.process_expired_dossiers_brouillon
|
||||||
end
|
end
|
||||||
|
@ -207,8 +207,8 @@ describe ExpiredDossiersDeletionService do
|
||||||
after { Timecop.return }
|
after { Timecop.return }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow(DossierMailer).to receive(:notify_automatic_deletion_to_user).and_return(double(deliver_later: nil))
|
allow(DossierMailer).to receive(:notify_automatic_deletion_to_user).and_call_original
|
||||||
allow(DossierMailer).to receive(:notify_automatic_deletion_to_administration).and_return(double(deliver_later: nil))
|
allow(DossierMailer).to receive(:notify_automatic_deletion_to_administration).and_call_original
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with a single dossier' do
|
context 'with a single dossier' do
|
||||||
|
@ -275,8 +275,8 @@ describe ExpiredDossiersDeletionService do
|
||||||
after { Timecop.return }
|
after { Timecop.return }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow(DossierMailer).to receive(:notify_near_deletion_to_user).and_return(double(deliver_later: nil))
|
allow(DossierMailer).to receive(:notify_near_deletion_to_user).and_call_original
|
||||||
allow(DossierMailer).to receive(:notify_near_deletion_to_administration).and_return(double(deliver_later: nil))
|
allow(DossierMailer).to receive(:notify_near_deletion_to_administration).and_call_original
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with a single dossier' do
|
context 'with a single dossier' do
|
||||||
|
@ -344,8 +344,8 @@ describe ExpiredDossiersDeletionService do
|
||||||
after { Timecop.return }
|
after { Timecop.return }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow(DossierMailer).to receive(:notify_automatic_deletion_to_user).and_return(double(deliver_later: nil))
|
allow(DossierMailer).to receive(:notify_automatic_deletion_to_user).and_call_original
|
||||||
allow(DossierMailer).to receive(:notify_automatic_deletion_to_administration).and_return(double(deliver_later: nil))
|
allow(DossierMailer).to receive(:notify_automatic_deletion_to_administration).and_call_original
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with a single dossier' do
|
context 'with a single dossier' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue