expect(record.errors[:saledate]).toinclude("Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
expect(record.errors[:saledate]).toinclude(/Enter a date within the \d{2}\/\d{2} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
end
end
context"when saledate is after the open collection year"do
expect(record.errors[:saledate]).toinclude("Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
expect(record.errors[:saledate]).toinclude(/Enter a date within the \d{2}\/\d{2} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
end
end
end
@ -106,20 +99,19 @@ RSpec.describe Validations::Sales::SetupValidations do
end
context"when current time is after the new logs end date but before edit end date for the previous period"do
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
it"can edit already created logs for the previous collection year"do