Merge pull request #6769 from betagouv/fix-tests

This commit is contained in:
Pierre de La Morinerie 2021-12-21 17:48:43 +01:00 committed by GitHub
commit 9944f1ba2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,10 +8,10 @@ describe ExpiredDossiersDeletionService do
let(:reference_date) { Date.parse("March 8") }
describe '#process_expired_dossiers_brouillon' do
let(:today) { Time.zone.now.at_midnight }
let(:date_close_to_expiration) { Date.today - procedure.duree_conservation_dossiers_dans_ds.months + 2.weeks }
let(:date_expired) { Date.today - procedure.duree_conservation_dossiers_dans_ds.months - 6.days }
let(:date_not_expired) { Date.today - procedure.duree_conservation_dossiers_dans_ds.months + 2.months }
let(:today) { Time.zone.now.at_beginning_of_day }
let(:date_close_to_expiration) { today - procedure.duree_conservation_dossiers_dans_ds.months + 13.days }
let(:date_expired) { today - procedure.duree_conservation_dossiers_dans_ds.months - 6.days }
let(:date_not_expired) { today - procedure.duree_conservation_dossiers_dans_ds.months + 2.months }
context 'send messages for dossiers expiring soon and delete expired' do
let!(:expired_brouillon) { create(:dossier, procedure: procedure, created_at: date_expired, brouillon_close_to_expiration_notice_sent_at: today - (warning_period + 3.days)) }