Fix test for the 2 months following February

The problem was caused by the variable lenght of 2.months.ago, used
in the test.
During the period from March 1st to April 29th, because February
is so short, the message would change from 'delai de 2 mois'
to 'delai de environ 2 mois', causing the test to fail.
This commit is contained in:
Frederic Merizen 2019-03-01 18:25:15 +01:00
parent 8ba8146a4a
commit d053a9bb8d

View file

@ -30,10 +30,14 @@ describe 'Dossier details:' do
let(:dossier) { create(:dossier, :en_instruction, :for_individual, :with_commentaires, user: user, procedure: procedure) }
before do
other_dossier = create(:dossier, :accepte, :for_individual, procedure: procedure, en_instruction_at: 2.months.ago, processed_at: Time.zone.now)
Timecop.freeze(Time.zone.local(2012, 12, 20))
other_dossier = create(:dossier, :accepte, :for_individual, procedure: procedure, en_instruction_at: 60.days.ago, processed_at: Time.zone.now)
visit dossier_path(dossier)
end
after { Timecop.return }
it { expect(page).to have_text("Habituellement, les dossiers de cette démarche sont traités dans un délai de 2 mois.") }
end
end