From 69093375003d1733fa924ae981157fe68aa384d0 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 17 May 2022 10:14:43 +0200 Subject: [PATCH] fix(spec): try fix dossier expiration spec --- spec/services/expired_dossiers_deletion_service_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/services/expired_dossiers_deletion_service_spec.rb b/spec/services/expired_dossiers_deletion_service_spec.rb index fece6b14f..653948ee1 100644 --- a/spec/services/expired_dossiers_deletion_service_spec.rb +++ b/spec/services/expired_dossiers_deletion_service_spec.rb @@ -8,6 +8,9 @@ describe ExpiredDossiersDeletionService do let(:reference_date) { Date.parse("March 8") } describe '#process_expired_dossiers_brouillon' do + before { Timecop.freeze(reference_date) } + after { Timecop.return } + 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 }