under_min:"The minimum initial equity stake for this type of shared ownership sale is %{min_equity}%"
over_max:"The maximum initial equity stake is %{max_equity}%"
mortgage:"Mortgage value cannot be £0 if a mortgage was used for the purchase of this property"
shared_ownership_deposit:"The %{mortgage_deposit_and_discount_error_fields} added together is %{mortgage_deposit_and_discount_total}. The value times the equity percentage is %{value_times_equity}. These figures should be the same"
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and cash discount added together is £2,000.00. The value times the equity percentage is £3,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and cash discount added together is £2,000.00. The value times the equity percentage is £3,000.00. These figures should be the same")
expect(record.errors["cashdis"]).toinclude("The mortgage, deposit, and cash discount added together is £2,000.00. The value times the equity percentage is £3,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and cash discount added together is £2,000.00. The value times the equity percentage is £3,000.00. These figures should be the same")
expect(record.errors["equity"]).toinclude("The mortgage, deposit, and cash discount added together is £2,000.00. The value times the equity percentage is £3,000.00. These figures should be the same")
end
it"does not add an error if no deposit is given"do
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and cash discount added together is £3,000.00. The value times the equity percentage is £4,323.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and cash discount added together is £3,000.00. The value times the equity percentage is £4,323.00. These figures should be the same")
expect(record.errors["cashdis"]).toinclude("The mortgage, deposit, and cash discount added together is £3,000.00. The value times the equity percentage is £4,323.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and cash discount added together is £3,000.00. The value times the equity percentage is £4,323.00. These figures should be the same")
expect(record.errors["equity"]).toinclude("The mortgage, deposit, and cash discount added together is £3,000.00. The value times the equity percentage is £4,323.00. These figures should be the same")
end
end
context"with a log in 23/24 collection year"do
let(:now){Time.zone.local(2024,1,1)}
it"does not add an error if MORTGAGE + DEPOSIT + CASHDIS are not equal VALUE * EQUITY/100"do