Merge pull request #4964 from tchak/fix-expiration-tests
Use bigger deltas to allow for month length variations
This commit is contained in:
commit
44ec4a739c
1 changed files with 4 additions and 4 deletions
|
@ -106,14 +106,14 @@ describe ExpiredDossiersDeletionService do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when a notice has been sent not so long ago' do
|
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 { dossier.reload }.not_to raise_error }
|
||||||
it { expect(DossierMailer).not_to have_received(:notify_brouillon_deletion) }
|
it { expect(DossierMailer).not_to have_received(:notify_brouillon_deletion) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when a notice has been sent a long time ago' do
|
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) }
|
it { expect { dossier.reload }.to raise_error(ActiveRecord::RecordNotFound) }
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ describe ExpiredDossiersDeletionService do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when a notice has been sent not so long ago' do
|
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 { dossier.reload }.not_to raise_error }
|
||||||
it { expect(DossierMailer).not_to have_received(:notify_automatic_deletion_to_user) }
|
it { expect(DossierMailer).not_to have_received(:notify_automatic_deletion_to_user) }
|
||||||
|
@ -241,7 +241,7 @@ describe ExpiredDossiersDeletionService do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when a notice has been sent a long time ago' do
|
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) }
|
it { expect { dossier.reload }.to raise_error(ActiveRecord::RecordNotFound) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue