feat(dossier): notify user by email about pending corrections
This commit is contained in:
parent
ca3b127942
commit
9565267170
9 changed files with 79 additions and 6 deletions
|
@ -507,13 +507,23 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
}, format: :turbo_stream
|
||||
end
|
||||
|
||||
before { sign_in(instructeur.user) }
|
||||
before do
|
||||
sign_in(instructeur.user)
|
||||
|
||||
allow(DossierMailer).to receive(:notify_pending_correction)
|
||||
.and_return(double(deliver_later: nil))
|
||||
end
|
||||
|
||||
context "dossier en instruction" do
|
||||
let(:dossier) { create(:dossier, :en_instruction, :with_individual, procedure: procedure) }
|
||||
|
||||
before { subject }
|
||||
|
||||
it 'sends an email to user' do
|
||||
expect(DossierMailer).to have_received(:notify_pending_correction).once
|
||||
expect(DossierMailer).to have_received(:notify_pending_correction).with(dossier)
|
||||
end
|
||||
|
||||
it 'pass en_construction and create a pending resolution' do
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(response.body).to include('en attente de modifications')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue