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