DossierController: use the new method send_notification
This commit is contained in:
parent
65d399b4b0
commit
36500407b4
2 changed files with 6 additions and 3 deletions
|
@ -88,10 +88,12 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
||||||
def receive
|
def receive
|
||||||
create_dossier_facade params[:dossier_id]
|
create_dossier_facade params[:dossier_id]
|
||||||
|
|
||||||
@facade.dossier.received!
|
dossier = @facade.dossier
|
||||||
|
|
||||||
|
dossier.received!
|
||||||
flash.notice = 'Dossier considéré comme reçu.'
|
flash.notice = 'Dossier considéré comme reçu.'
|
||||||
|
|
||||||
NotificationMailer.dossier_received(@facade.dossier).deliver_now!
|
NotificationMailer.send_notification(dossier, dossier.procedure.initiated_mail).deliver_now!
|
||||||
|
|
||||||
redirect_to backoffice_dossier_path(id: @facade.dossier.id)
|
redirect_to backoffice_dossier_path(id: @facade.dossier.id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -236,7 +236,8 @@ describe Backoffice::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Notification email is send' do
|
it 'Notification email is send' do
|
||||||
expect(NotificationMailer).to receive(:dossier_received).and_return(NotificationMailer)
|
expect(NotificationMailer).to receive(:send_notification)
|
||||||
|
.with(dossier, kind_of(InitiatedMail)).and_return(NotificationMailer)
|
||||||
expect(NotificationMailer).to receive(:deliver_now!)
|
expect(NotificationMailer).to receive(:deliver_now!)
|
||||||
|
|
||||||
subject
|
subject
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue