Merge pull request #10705 from demarches-simplifiees/email-expert-need-confirmation-ldu

ETQ expert, je dois confirmer mon mail
This commit is contained in:
Lisa Durand 2024-08-22 12:53:52 +00:00 committed by GitHub
commit 8e7e8d9624
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 122 additions and 21 deletions

View file

@ -29,14 +29,14 @@ describe Instructeurs::AvisController, type: :controller do
describe 'remind' do
before do
allow(AvisMailer).to receive(:avis_invitation).and_return(double(deliver_later: nil))
allow(AvisMailer).to receive(:avis_invitation_and_confirm_email).and_return(double(deliver_later: nil))
end
context 'without question' do
let!(:avis) { create(:avis, dossier: dossier, claimant: instructeur, experts_procedure: experts_procedure) }
it 'sends a reminder to the expert' do
get :remind, params: { procedure_id: procedure.id, id: avis.id }
expect(AvisMailer).to have_received(:avis_invitation).once.with(avis)
expect(AvisMailer).to have_received(:avis_invitation_and_confirm_email)
expect(flash.notice).to eq("Un mail de relance a été envoyé à #{avis.expert.email}")
expect(avis.reload.reminded_at).to be_present
end
@ -47,7 +47,7 @@ describe Instructeurs::AvisController, type: :controller do
it 'sends a reminder to the expert' do
get :remind, params: { procedure_id: procedure.id, id: avis.id }
expect(AvisMailer).to have_received(:avis_invitation).once.with(avis)
expect(AvisMailer).to have_received(:avis_invitation_and_confirm_email)
expect(flash.notice).to eq("Un mail de relance a été envoyé à #{avis.expert.email}")
expect(avis.reload.reminded_at).to be_present
end

View file

@ -83,7 +83,7 @@ describe Users::ActivateController, type: :controller do
end
it 'redirects to root path with an explanation notice and it send a new link if user present' do
expect { subject }.to have_enqueued_mail(UserMailer, :invite_tiers)
expect { subject }.to have_enqueued_mail(UserMailer, :resend_confirmation_email)
expect(response).to redirect_to(root_path(user))
expect(flash[:alert]).to eq("Ce lien n'est plus valable, un nouveau lien a été envoyé à l'adresse #{user.email}")
end