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 }