Bug with time zone when testing sending of brouillon expiration notices

This commit is contained in:
maatinito 2019-12-10 08:46:51 -10:00 committed by simon lehericey
parent 9672d892e9
commit a02a5edce3

View file

@ -1049,12 +1049,13 @@ describe Dossier do
end
describe '#send_brouillon_expiration_notices' do
let!(:procedure) { create(:procedure, duree_conservation_dossiers_dans_ds: 6) }
let!(:date_close_to_expiration) { Date.today - procedure.duree_conservation_dossiers_dans_ds.months + 1.month }
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 }
before { Timecop.freeze(Time.zone.parse('12/12/2012 15:00:00')) }
let!(:procedure) { create(:procedure, duree_conservation_dossiers_dans_ds: 6) }
let!(:date_close_to_expiration) { Time.zone.now - procedure.duree_conservation_dossiers_dans_ds.months + 1.month }
let!(:date_expired) { Time.zone.now - procedure.duree_conservation_dossiers_dans_ds.months - 6.days }
let!(:date_not_expired) { Time.zone.now - procedure.duree_conservation_dossiers_dans_ds.months + 2.months }
before { Timecop.freeze(Time.zone.parse('12/12/2012').beginning_of_day) }
after { Timecop.return }
context "Envoi de message pour les dossiers expirant dans - d'un mois" do