Merge pull request #2924 from betagouv/frederic/fix_flaky_test

Fix test that doesn't work just after daylight saving time changes
This commit is contained in:
Frederic Merizen 2018-10-30 11:18:35 +01:00 committed by GitHub
commit a3a560ae98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,7 +244,7 @@ describe StatsController, type: :controller do
describe "#avis_average_answer_time" do
before do
Timecop.freeze(Time.zone.now)
Timecop.freeze(Time.zone.local(2016, 10, 2))
# 1 week ago
create(:avis, answer: "voila ma réponse", created_at: 1.week.ago + 1.day, updated_at: 1.week.ago + 2.days) # 1 day