diff --git a/app/views/users/dossiers/_merci.html.haml b/app/views/users/dossiers/_merci.html.haml index e92ec351a41..383f502d96e 100644 --- a/app/views/users/dossiers/_merci.html.haml +++ b/app/views/users/dossiers/_merci.html.haml @@ -11,7 +11,7 @@ %strong= t('views.users.dossiers.merci.dossier_acces_l2') %p.m-2 = t('views.users.dossiers.merci.dossier_edit_l1') - - if !dossier&.read_only? + - if !dossier&.read_only? && !procedure.declarative_accepte? && !procedure.sva_svr_enabled? %strong= t('views.users.dossiers.merci.dossier_edit_l2') = t('views.users.dossiers.merci.dossier_edit_l3') %strong= t('views.users.dossiers.merci.dossier_edit_l4') diff --git a/spec/mailers/application_mailer_spec.rb b/spec/mailers/application_mailer_spec.rb index 99585b8a21a..814d8a43073 100644 --- a/spec/mailers/application_mailer_spec.rb +++ b/spec/mailers/application_mailer_spec.rb @@ -75,6 +75,8 @@ let(:user1) { create(:user) } let(:user2) { create(:user, email: "your@email.com") } + before { freeze_time } + it 'creates a new EmailEvent record with the correct information' do expect { UserMailer.ask_for_merge(user1, user2.email).deliver_now }.to change { EmailEvent.count }.by(2) event = EmailEvent.last @@ -83,7 +85,7 @@ expect(event.to).to eq("your@email.com") expect(event.method).to eq("test") expect(event.subject).to eq('Fusion de compte') - expect(event.processed_at).to be_within(1.second).of(Time.zone.now) + expect(event.processed_at).to eq(Time.current) expect(event.status).to eq('dispatched') end end