diff --git a/spec/services/expired_dossiers_deletion_service_spec.rb b/spec/services/expired_dossiers_deletion_service_spec.rb index c50803963..b4ac30b4e 100644 --- a/spec/services/expired_dossiers_deletion_service_spec.rb +++ b/spec/services/expired_dossiers_deletion_service_spec.rb @@ -106,14 +106,14 @@ describe ExpiredDossiersDeletionService do end context 'when a notice has been sent not so long ago' do - let(:notice_sent_at) { (warning_period - 1.day).ago } + let(:notice_sent_at) { (warning_period - 4.days).ago } it { expect { dossier.reload }.not_to raise_error } it { expect(DossierMailer).not_to have_received(:notify_brouillon_deletion) } end context 'when a notice has been sent a long time ago' do - let(:notice_sent_at) { (warning_period + 1.day).ago } + let(:notice_sent_at) { (warning_period + 4.days).ago } it { expect { dossier.reload }.to raise_error(ActiveRecord::RecordNotFound) } @@ -233,7 +233,7 @@ describe ExpiredDossiersDeletionService do end context 'when a notice has been sent not so long ago' do - let(:notice_sent_at) { (warning_period - 1.day).ago } + let(:notice_sent_at) { (warning_period - 4.days).ago } it { expect { dossier.reload }.not_to raise_error } it { expect(DossierMailer).not_to have_received(:notify_automatic_deletion_to_user) } @@ -241,7 +241,7 @@ describe ExpiredDossiersDeletionService do end context 'when a notice has been sent a long time ago' do - let(:notice_sent_at) { (warning_period + 1.day).ago } + let(:notice_sent_at) { (warning_period + 4.days).ago } it { expect { dossier.reload }.to raise_error(ActiveRecord::RecordNotFound) }