Browse Source

Update tests and validations

pull/2713/head
Kat 2 years ago
parent
commit
fcf3bfe095
  1. 6
      app/models/validations/sales/setup_validations.rb
  2. 6
      app/models/validations/setup_validations.rb
  3. 4
      config/locales/en.yml
  4. 4
      config/locales/validations/sales/setup.en.yml
  5. 11
      spec/features/bulk_upload_lettings_logs_spec.rb
  6. 6
      spec/features/bulk_upload_sales_logs_spec.rb
  7. 2
      spec/features/sales_log_spec.rb
  8. 12
      spec/helpers/filters_helper_spec.rb
  9. 8
      spec/helpers/tasklist_helper_spec.rb
  10. 16
      spec/models/validations/sales/setup_validations_spec.rb
  11. 30
      spec/models/validations/setup_validations_spec.rb
  12. 2
      spec/requests/lettings_logs_controller_spec.rb
  13. 2
      spec/requests/sales_logs_controller_spec.rb

6
app/models/validations/sales/setup_validations.rb

@ -80,14 +80,18 @@ private
if FormHandler.instance.sales_in_crossover_period?
I18n.t(
"validations.sales.setup.saledate.must_be_within.previous_and_current_collection_year",
previous_end_year_long: previous_collection_end_date.strftime("#{previous_collection_end_date.day.ordinalize} %B %Y"),
previous_start_year_short: previous_collection_start_date.strftime("%Y"),
previous_end_year_short: previous_collection_end_date.strftime("%Y"),
previous_start_year_long: previous_collection_start_date.strftime("#{previous_collection_start_date.day.ordinalize} %B %Y"),
current_end_year_short: current_collection_end_date.strftime("%Y"),
current_end_year_long: current_collection_end_date.strftime("#{current_collection_end_date.day.ordinalize} %B %Y"),
)
else
I18n.t(
"validations.sales.setup.saledate.must_be_within.current_collection_year",
current_start_year_short: current_collection_start_date.strftime("%Y"),
current_start_year_long: current_collection_start_date.strftime("#{current_collection_start_date.day.ordinalize} %B %Y"),
current_end_year_short: current_collection_end_date.strftime("%Y"),
current_end_year_long: current_collection_end_date.strftime("#{current_collection_end_date.day.ordinalize} %B %Y"),
)
end

6
app/models/validations/setup_validations.rb

@ -130,13 +130,17 @@ private
if FormHandler.instance.lettings_in_crossover_period?
I18n.t(
"validations.setup.startdate.previous_and_current_collection_year",
previous_end_year_long: previous_collection_end_date.strftime("#{previous_collection_end_date.day.ordinalize} %B %Y"),
previous_start_year_short: previous_collection_start_date.strftime("%Y"),
previous_end_year_short: previous_collection_end_date.strftime("%Y"),
previous_start_year_long: previous_collection_start_date.strftime("#{previous_collection_start_date.day.ordinalize} %B %Y"),
current_end_year_short: current_collection_end_date.strftime("%Y"),
current_end_year_long:,
)
else
I18n.t(
"validations.setup.startdate.current_collection_year",
current_start_year_short: current_collection_start_date.strftime("%Y"),
current_end_year_short: current_collection_end_date.strftime("%Y"),
current_start_year_long: current_collection_start_date.strftime("#{current_collection_start_date.day.ordinalize} %B %Y"),
current_end_year_long:,
)

4
config/locales/en.yml

@ -287,9 +287,9 @@ en:
startdate:
current_collection_year:
"Enter a date within the %{current_start_year_long} to %{current_end_year_long} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
"Enter a date within the %{current_start_year_short} to %{current_end_year_short} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
previous_and_current_collection_year:
"Enter a date within the %{previous_start_year_long} to %{previous_end_year_long} or %{previous_end_year_long} to %{current_end_year_long} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
"Enter a date within the %{previous_start_year_short} to %{previous_end_year_short} or %{previous_end_year_short} to %{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
later_than_14_days_after: "The tenancy start date must not be later than 14 days from today’s date."
before_scheme_end_date: "The tenancy start date must be before the end date for this supported housing scheme."
after_void_date: "Enter a tenancy start date that is after the void date."

4
config/locales/validations/sales/setup.en.yml

@ -7,9 +7,9 @@ en:
next_two_weeks: "Sale completion date must not be later than 14 days from today’s date."
must_be_within:
current_collection_year:
"Enter a date within the %{current_start_year_long} to %{current_end_year_long} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
"Enter a date within the %{current_start_year_short} to %{current_end_year_short} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
previous_and_current_collection_year:
"Enter a date within the %{previous_start_year_long} to %{previous_end_year_long} or %{previous_end_year_long} to %{current_end_year_long} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
"Enter a date within the %{previous_start_year_short} to %{previous_end_year_short} or %{previous_end_year_short} to %{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
invalid:
merged_organisations:
"Enter a date when the owning organisation was active. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."

11
spec/features/bulk_upload_lettings_logs_spec.rb

@ -5,8 +5,7 @@ RSpec.describe "Bulk upload lettings log" do
let(:user) { create(:user) }
let(:current_year) { current_collection_start_year }
let(:current_formatted_year) { "#{current_year}/#{current_year + 1}" }
let(:current_formatted_short_year) { "#{current_year}/#{current_year - 2000 + 1}" }
let(:current_formatted_year) { "#{current_year} to #{current_year + 1}" }
let(:stub_file_upload) do
vcap_services = { "aws-s3-bucket" => {} }
@ -47,12 +46,12 @@ RSpec.describe "Bulk upload lettings log" do
expect(page.find_field("form-year-#{current_year}-field")).to be_checked
click_button("Continue")
expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_short_year})")
expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_year})")
click_button("Continue")
expect(page).not_to have_content("What is the needs type?")
expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_short_year})")
expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_year})")
expect(page).to have_content("Upload your file")
click_button("Upload")
@ -88,7 +87,7 @@ RSpec.describe "Bulk upload lettings log" do
expect(page).to have_link("Upload lettings logs in bulk")
click_link("Upload lettings logs in bulk")
expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_short_year})")
expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_year})")
click_button("Continue")
expect(page).to have_content("Upload your file")
@ -107,7 +106,7 @@ RSpec.describe "Bulk upload lettings log" do
expect(page).to have_content("Prepare your file")
click_button("Continue")
expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_short_year})")
expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_year})")
expect(page).to have_content("Upload your file")
click_button("Upload")

6
spec/features/bulk_upload_sales_logs_spec.rb

@ -38,7 +38,7 @@ RSpec.describe "Bulk upload sales log" do
click_button("Continue")
expect(page).to have_content("You must select a collection period to upload for")
choose("2023/2024")
choose("2023 to 2024")
click_button("Continue")
click_link("Back")
@ -46,7 +46,7 @@ RSpec.describe "Bulk upload sales log" do
expect(page.find_field("form-year-2023-field")).to be_checked
click_button("Continue")
expect(page).to have_content("Upload sales logs in bulk (2023/24)")
expect(page).to have_content("Upload sales logs in bulk (2023 to 2024)")
click_button("Continue")
expect(page).to have_content("Upload your file")
@ -88,7 +88,7 @@ RSpec.describe "Bulk upload sales log" do
expect(page).to have_link("Upload sales logs in bulk")
click_link("Upload sales logs in bulk")
expect(page).to have_content("Upload sales logs in bulk (2023/24)")
expect(page).to have_content("Upload sales logs in bulk (2023 to 2024)")
click_button("Continue")
expect(page).to have_content("Upload your file")

2
spec/features/sales_log_spec.rb

@ -191,7 +191,7 @@ RSpec.describe "Sales Log Features" do
context "when one year filter is selected" do
before do
check("2024")
check("2024 to 2025")
click_button("Apply filters")
end

12
spec/helpers/filters_helper_spec.rb

@ -491,7 +491,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_options).to eq(
{
"2023" => "2023/24", "2022" => "2022/23", "2021" => "2021/22"
"2023" => "2023 to 2024", "2022" => "2022 to 2023", "2021" => "2021 to 2022"
},
)
end
@ -505,7 +505,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_options).to eq(
{
"2023" => "2023/24", "2022" => "2022/23"
"2023" => "2023 to 2024", "2022" => "2022 to 2023"
},
)
end
@ -520,7 +520,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_options).to eq(
{
"2024" => "2024/25", "2023" => "2023/24", "2022" => "2022/23"
"2024" => "2024 to 2025", "2023" => "2023 to 2024", "2022" => "2022 to 2023"
},
)
end
@ -541,7 +541,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_radio_options).to eq(
{
"2023" => { label: "2023/24" }, "2022" => { label: "2022/23" }, "2021" => { label: "2021/22" }
"2023" => { label: "2023 to 2024" }, "2022" => { label: "2022 to 2023" }, "2021" => { label: "2021 to 2022" }
},
)
end
@ -555,7 +555,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_radio_options).to eq(
{
"2023" => { label: "2023/24" }, "2022" => { label: "2022/23" }
"2023" => { label: "2023 to 2024" }, "2022" => { label: "2022 to 2023" }
},
)
end
@ -570,7 +570,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_radio_options).to eq(
{
"2024" => { label: "2024/25" }, "2023" => { label: "2023/24" }, "2022" => { label: "2022/23" }
"2024" => { label: "2024 to 2025" }, "2023" => { label: "2023 to 2024" }, "2022" => { label: "2022 to 2023" }
},
)
end

8
spec/helpers/tasklist_helper_spec.rb

@ -143,7 +143,7 @@ RSpec.describe TasklistHelper do
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.")
expect(review_log_text(sales_log)).to eq("This log is from the 2022 to 2023 collection window, which is now closed.")
end
end
@ -156,7 +156,7 @@ RSpec.describe TasklistHelper do
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.")
expect(review_log_text(sales_log)).to eq("This log is from the 2021 to 2022 collection window, which is now closed.")
end
end
end
@ -186,7 +186,7 @@ RSpec.describe TasklistHelper do
end
it "returns relevant text" do
expect(review_log_text(lettings_log)).to eq("This log is from the 2022/2023 collection window, which is now closed.")
expect(review_log_text(lettings_log)).to eq("This log is from the 2022 to 2023 collection window, which is now closed.")
end
end
@ -199,7 +199,7 @@ RSpec.describe TasklistHelper do
end
it "returns relevant text" do
expect(review_log_text(lettings_log)).to eq("This log is from the 2021/2022 collection window, which is now closed.")
expect(review_log_text(lettings_log)).to eq("This log is from the 2021 to 2022 collection window, which is now closed.")
end
end
end

16
spec/models/validations/sales/setup_validations_spec.rb

@ -37,7 +37,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "adds error" do
setup_validator.validate_saledate_collection_year(record)
expect(record.errors[:saledate]).to include(/Enter a date within the \d{2}\/\d{2} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
expect(record.errors[:saledate]).to include(/Enter a date within the \d{4} to \d{4} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
end
end
@ -47,7 +47,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "adds error" do
setup_validator.validate_saledate_collection_year(record)
expect(record.errors[:saledate]).to include(/Enter a date within the \d{2}\/\d{2} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
expect(record.errors[:saledate]).to include(/Enter a date within the \d{4} to \d{4} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
end
end
end
@ -91,7 +91,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "adds error" do
setup_validator.validate_saledate_collection_year(record)
expect(record.errors[:saledate]).to include("Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
expect(record.errors[:saledate]).to include("Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
@ -105,7 +105,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "adds error" do
setup_validator.validate_saledate_collection_year(record)
expect(record.errors[:saledate]).to include("Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
expect(record.errors[:saledate]).to include("Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
@ -119,7 +119,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "cannot create new logs for the archived collection year" do
record.saledate = Time.zone.local(2023, 1, 1)
setup_validator.validate_saledate_collection_year(record)
expect(record.errors["saledate"]).to include(match "Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
expect(record.errors["saledate"]).to include(match "Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
it "can edit already created logs for the previous collection year" do
@ -127,7 +127,7 @@ RSpec.describe Validations::Sales::SetupValidations do
record.save!(validate: false)
record.saledate = Time.zone.local(2024, 1, 1)
setup_validator.validate_saledate_collection_year(record)
expect(record.errors["saledate"]).not_to include(match "Enter a date within the 24/25 collection year, which is between 1st April 2024 and 31st March 2025.")
expect(record.errors["saledate"]).not_to include(match "Enter a date within the 2024 to 2025 collection year, which is between 1st April 2024 and 31st March 2025.")
end
end
@ -142,7 +142,7 @@ RSpec.describe Validations::Sales::SetupValidations do
record.update!(saledate: nil)
record.saledate = Time.zone.local(2023, 1, 1)
setup_validator.validate_saledate_collection_year(record)
expect(record.errors["saledate"]).to include(match "Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
expect(record.errors["saledate"]).to include(match "Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
it "cannot edit already created logs for the archived collection year" do
@ -150,7 +150,7 @@ RSpec.describe Validations::Sales::SetupValidations do
record.save!(validate: false)
record.saledate = Time.zone.local(2023, 1, 1)
setup_validator.validate_saledate_collection_year(record)
expect(record.errors["saledate"]).to include(match "Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
expect(record.errors["saledate"]).to include(match "Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
end

30
spec/models/validations/setup_validations_spec.rb

@ -7,7 +7,7 @@ RSpec.describe Validations::SetupValidations do
let(:record) { build(:lettings_log) }
describe "tenancy start date" do
context "when in 22/23 collection" do
context "when in 2022 to 2023 collection" do
context "when in the crossover period" do
before do
allow(Time).to receive(:now).and_return(Time.zone.local(2022, 4, 1))
@ -18,14 +18,14 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2021, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 21/22 or 22/23 collection years, which is between 1st April 2021 and 31st March 2023")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2021 to 2022 or 2022 to 2023 collection years, which is between 1st April 2021 and 31st March 2023")
end
it "cannot be after the second collection window end date" do
record.startdate = Time.zone.local(2023, 7, 1, 6)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 21/22 or 22/23 collection years, which is between 1st April 2021 and 31st March 2023")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2021 to 2022 or 2022 to 2023 collection years, which is between 1st April 2021 and 31st March 2023")
end
end
@ -39,19 +39,19 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2022, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2022 to 2023 collection year, which is between 1st April 2022 and 31st March 2023")
end
it "cannot be after the second collection window end date" do
record.startdate = Time.zone.local(2023, 7, 1, 6)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2022 to 2023 collection year, which is between 1st April 2022 and 31st March 2023")
end
end
end
context "when in 23/24 collection" do
context "when in 2023 to 2024 collection" do
context "when in the crossover period" do
before do
allow(Time).to receive(:now).and_return(Time.zone.local(2023, 4, 1))
@ -62,14 +62,14 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2022, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 22/23 or 23/24 collection years, which is between 1st April 2022 and 31st March 2024")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2022 to 2023 or 2023 to 2024 collection years, which is between 1st April 2022 and 31st March 2024")
end
it "cannot be after the second collection window end date" do
record.startdate = Time.zone.local(2024, 7, 1, 6)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 22/23 or 23/24 collection years, which is between 1st April 2022 and 31st March 2024")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2022 to 2023 or 2023 to 2024 collection years, which is between 1st April 2022 and 31st March 2024")
end
end
@ -83,14 +83,14 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
it "cannot be after the second collection window end date" do
record.startdate = Time.zone.local(2024, 7, 1, 6)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
@ -104,7 +104,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
xit "can edit already created logs for the previous collection year" do
@ -113,7 +113,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).not_to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).not_to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
@ -127,7 +127,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
it "cannot edit already created logs for the previous collection year" do
@ -136,7 +136,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
end
@ -157,7 +157,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2024, 4, 1)
setup_validator.validate_startdate_setup(record)
expect(record.errors["startdate"].length).to be >= 2
expect(record.errors["startdate"][0]).to eq("Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024.")
expect(record.errors["startdate"][0]).to eq("Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024.")
expect(record.errors["startdate"][1]).to eq(I18n.t("validations.setup.startdate.later_than_14_days_after"))
end
end

2
spec/requests/lettings_logs_controller_spec.rb

@ -1177,7 +1177,7 @@ RSpec.describe LettingsLogsController, type: :request do
it "displays a closed collection window message for previous collection year logs" do
follow_redirect!
expect(page).to have_content(/This log is from the \d{4}\/\d{4} collection window, which is now closed\./)
expect(page).to have_content(/This log is from the \d{4} to \d{4} collection window, which is now closed\./)
end
end

2
spec/requests/sales_logs_controller_spec.rb

@ -954,7 +954,7 @@ RSpec.describe SalesLogsController, type: :request do
expect(completed_sales_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 12, 31))
expect(completed_sales_log.status).to eq("completed")
follow_redirect!
expect(page).to have_content("This log is from the 2021/2022 collection window, which is now closed.")
expect(page).to have_content("This log is from the 2021 to 2022 collection window, which is now closed.")
end
end
end

Loading…
Cancel
Save