expect(record.errors["saledate"]).toinclude(match"Enter a date within the 24/25 collection year, which is between 1st April 2024 and 31st March 2025")
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025")
end
xit"can edit already created logs for the previous collection year"do
@ -131,19 +135,19 @@ RSpec.describe Validations::Sales::SetupValidations do
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 24/25 collection year, which is between 1st April 2024 and 31st March 2025")
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025")
end
it"cannot edit already created logs for the previous collection year"do
record.saledate=Time.zone.local(2024,1,2)
it"cannot edit already created logs for the archived collection year"do
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 24/25 collection year, which is between 1st April 2024 and 31st March 2025")
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025")