must_be_after_hodate:"Sale completion date must be after practical completion or handover date"
previous_property_type:
property_type_bedsit:"A bedsit cannot have more than 1 bedroom"
discounted_ownership_value:"The mortgage, deposit, and grant when added together is %{mortgage_deposit_and_grant_total}, and the purchase purchase price times by the discount is %{value_with_discount}. These figures should be the same"
discounted_ownership_value:"The mortgage, deposit, and grant when added together is %{mortgage_deposit_and_grant_total}, and the purchase price times by the discount is %{value_with_discount}. These figures should be the same"
outright_sale_value:"The mortgage and deposit when added together is %{mortgage_and_deposit_total}, and the purchase price is %{value}. These figures should be the same."
monthly_rent:
higher_than_expected:"Basic monthly rent must be between £0.00 and £9,999.00"
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £49,999.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £49,999.00. These figures should be the same")
end
it"adds an error if mortgage, deposit and grant at least 1 less than discounted value"do
@ -258,13 +258,13 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £50,001.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £50,000.00, and the purchase price times by the discount is £50,001.00. These figures should be the same")
end
it"does not add an error if mortgage, deposit and grant less than 1 greater than discounted value"do
@ -347,13 +347,13 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
it"returns true if mortgage and deposit total does not equal market value - discount"do
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase price times by the discount is £27,000.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £15,000.00, and the purchase price times by the discount is £27,000.00. These figures should be the same")
end
it"returns false if mortgage and deposit total equals market value - discount"do
@ -376,13 +376,13 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
it"returns true if mortgage and deposit total does not equal market value"do
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase price times by the discount is £30,000.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £12,000.00, and the purchase price times by the discount is £30,000.00. These figures should be the same")
end
it"returns false if mortgage and deposit total equals market value"do
@ -422,13 +422,13 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
it"returns true if mortgage, grant and deposit total does not equal market value - discount"do
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £8,010.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
end
it"returns false if mortgage, grant and deposit total equals market value - discount"do
@ -450,13 +450,13 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
it"returns true if grant and deposit total does not equal market value - discount"do
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["mortgageused"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["value"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["ownershipsch"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["discount"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
expect(record.errors["grant"]).toinclude("The mortgage, deposit, and grant when added together is £8,000.00, and the purchase price times by the discount is £18,000.00. These figures should be the same")
end
it"returns false if mortgage, grant and deposit total equals market value - discount"do
@ -1230,7 +1230,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do
it"only adds errors to the discounted ownership field"do
expect(parser.errors[:field_103]).tobe_empty
expect(parser.errors[:field_117]).toinclude("The mortgage, deposit, and grant when added together is £100.00, and the purchase purchase price times by the discount is £90.00. These figures should be the same")
expect(parser.errors[:field_117]).toinclude("The mortgage, deposit, and grant when added together is £100.00, and the purchase price times by the discount is £90.00. These figures should be the same")