From dab1ee25db75e00ce1002a06e7386c0042c9e082 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 2 Jan 2025 10:28:11 +0000 Subject: [PATCH] Fix dates to depend of collections in homepage tests (#2880) --- spec/presenters/homepage_presenter_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/presenters/homepage_presenter_spec.rb b/spec/presenters/homepage_presenter_spec.rb index 857482abd..aa10c8cde 100644 --- a/spec/presenters/homepage_presenter_spec.rb +++ b/spec/presenters/homepage_presenter_spec.rb @@ -5,8 +5,8 @@ RSpec.describe HomepagePresenter do let(:user) { create(:user, organisation:) } let(:in_crossover_period) { true } let(:presenter) { described_class.new(user) } - let(:date_this_year) { Time.zone.today } - let(:date_last_year) { Time.zone.today - 1.year } + let(:date_this_year) { FormHandler.instance.current_collection_start_date } + let(:date_last_year) { FormHandler.instance.previous_collection_start_date } let(:expected_count) { rand 1..10 } before do