From b9d13df483399e9b45a39062fe4740180e6facbc Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 16 Dec 2021 15:02:17 +0100 Subject: [PATCH] fix(spec): avoid flacky test. 15.days ago is not always on the previous month. eg: this spec failed on 16 of december, stats is still in december --- spec/controllers/stats_controller_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/controllers/stats_controller_spec.rb b/spec/controllers/stats_controller_spec.rb index 4e9ae2e17..f05cddba1 100644 --- a/spec/controllers/stats_controller_spec.rb +++ b/spec/controllers/stats_controller_spec.rb @@ -1,4 +1,7 @@ describe StatsController, type: :controller do + before { Timecop.travel(Date.parse("2021/12/15")) } + after { Timecop.return } + describe "#last_four_months_hash" do context "while a regular user is logged in" do before do