This commit is contained in:
Lisa Durand 2024-08-22 11:27:28 +02:00
parent 3cf3dc4623
commit fae81d0a58
No known key found for this signature in database
GPG key ID: 0DF91F2CA1E8B816
3 changed files with 5 additions and 5 deletions

View file

@ -27,14 +27,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
@ -45,7 +45,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

@ -81,7 +81,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

View file

@ -191,7 +191,7 @@ describe User, type: :model do
user = subject
expect(user.valid_password?(password)).to be true
expect(user.confirmed_at).to be_present
expect(user.email_verified_at).to be_present
expect(user.email_verified_at).to be_nil
expect(user.expert).to be_present
end
end