From ab6c38aa3c49ce4de08c78d5d7a7b76dd0da9b0a Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 22 May 2024 08:52:49 +0100 Subject: [PATCH] Update task list helper --- spec/helpers/tasklist_helper_spec.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/spec/helpers/tasklist_helper_spec.rb b/spec/helpers/tasklist_helper_spec.rb index 658fc1839..c5897582f 100644 --- a/spec/helpers/tasklist_helper_spec.rb +++ b/spec/helpers/tasklist_helper_spec.rb @@ -142,6 +142,11 @@ RSpec.describe TasklistHelper do allow(sales_log).to receive(:collection_period_open?).and_return(false) end + before do + allow(sales_log.form).to receive(:submission_deadline).and_return(Time.utc(2023, 6, 9)) + allow(sales_log).to receive(:collection_period_open?).and_return(false) + end + it "returns relevant text" do expect(review_log_text(sales_log)).to eq("This log is from the 2022/2023 collection window, which is now closed.") end @@ -155,6 +160,11 @@ RSpec.describe TasklistHelper do allow(sales_log).to receive(:older_than_previous_collection_year?).and_return(true) end + before do + allow(sales_log.form).to receive(:submission_deadline).and_return(Time.utc(2022, 6, 9)) + allow(sales_log).to receive(:older_than_previous_collection_year?).and_return(true) + end + it "returns relevant text" do expect(review_log_text(sales_log)).to eq("This log is from the 2021/2022 collection window, which is now closed.") end @@ -186,8 +196,8 @@ RSpec.describe TasklistHelper do end before do - allow(sales_log.form).to receive(:submission_deadline).and_return(Time.utc(2023, 6, 9)) - allow(sales_log).to receive(:collection_period_open?).and_return(false) + allow(lettings_log.form).to receive(:submission_deadline).and_return(Time.utc(2023, 6, 9)) + allow(lettings_log).to receive(:collection_period_open?).and_return(false) end it "returns relevant text" do