@ -17,13 +17,13 @@ RSpec.describe Validations::SetupValidations do
it"cannot be before the first collection window start date"do
record.startdate=Time.zone.local(2021,1,1)
setup_validator.validate_startdate_setup(record)
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 21/22 or 22/23 financial years, which is between 1st April 2021 and 1st July 2023")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 21/22 or 22/23 financial 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)
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 21/22 or 22/23 financial years, which is between 1st April 2021 and 1st July 2023")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 21/22 or 22/23 financial years, which is between 1st April 2021 and 31st March 2023")
end
end
@ -36,13 +36,13 @@ RSpec.describe Validations::SetupValidations do
it"cannot be before the first collection window start date"do
record.startdate=Time.zone.local(2022,1,1)
setup_validator.validate_startdate_setup(record)
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 financial year, which is between 1st April 2022 and 1st July 2023")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 financial 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)
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 financial year, which is between 1st April 2022 and 1st July 2023")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 financial year, which is between 1st April 2022 and 31st March 2023")
end
end
end
@ -57,13 +57,13 @@ RSpec.describe Validations::SetupValidations do
it"cannot be before the first collection window start date"do
record.startdate=Time.zone.local(2022,1,1)
setup_validator.validate_startdate_setup(record)
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 or 23/24 financial years, which is between 1st April 2022 and 9th July 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 or 23/24 financial 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)
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 or 23/24 financial years, which is between 1st April 2022 and 9th July 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 or 23/24 financial years, which is between 1st April 2022 and 31st March 2024")
end
end
@ -76,13 +76,13 @@ RSpec.describe Validations::SetupValidations do
it"cannot be before the first collection window start date"do
record.startdate=Time.zone.local(2023,1,1)
setup_validator.validate_startdate_setup(record)
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 financial year, which is between 1st April 2023 and 9th July 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 financial 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)
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 financial year, which is between 1st April 2023 and 9th July 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 financial year, which is between 1st April 2023 and 31st March 2024")