Browse Source

Update task list helper

pull/2445/head
Kat 2 years ago
parent
commit
ab6c38aa3c
  1. 14
      spec/helpers/tasklist_helper_spec.rb

14
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) allow(sales_log).to receive(:collection_period_open?).and_return(false)
end 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 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.") expect(review_log_text(sales_log)).to eq("This log is from the 2022/2023 collection window, which is now closed.")
end end
@ -155,6 +160,11 @@ RSpec.describe TasklistHelper do
allow(sales_log).to receive(:older_than_previous_collection_year?).and_return(true) allow(sales_log).to receive(:older_than_previous_collection_year?).and_return(true)
end 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 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.") expect(review_log_text(sales_log)).to eq("This log is from the 2021/2022 collection window, which is now closed.")
end end
@ -186,8 +196,8 @@ RSpec.describe TasklistHelper do
end end
before do before do
allow(sales_log.form).to receive(:submission_deadline).and_return(Time.utc(2023, 6, 9)) allow(lettings_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).to receive(:collection_period_open?).and_return(false)
end end
it "returns relevant text" do it "returns relevant text" do

Loading…
Cancel
Save