mortgage_used:"The mortgage and deposit added together is %{mortgage_and_deposit_total} and the purchase price times by the equity is %{expected_shared_ownership_deposit_value}. These figures should be the same."
mortgage_not_used:"The deposit is %{deposit} and the purchase price times by the equity is %{expected_shared_ownership_deposit_value}. As no mortgage was used, these figures should be the same."
mortgage_used_socialhomebuy:"The mortgage, deposit and cash discount added together is %{mortgage_deposit_and_discount_total} and the purchase price times by the equity is %{expected_shared_ownership_deposit_value}. These figures should be the same."
mortgage_not_used_socialhomebuy:"The deposit and cash discount added together is %{deposit_and_discount_total} and the purchase price times by the equity is %{expected_shared_ownership_deposit_value}. As no mortgage was used, these figures should be the same."
staircasing_mortgage:
mortgage_used:"The mortgage and deposit added together is %{mortgage_and_deposit_total} and the percentage bought times the purchase price is %{stairbought_part_of_value}. These figures should be the same."
mortgage_not_used:"The deposit is %{deposit} and the percentage bought times the purchase price is %{stairbought_part_of_value}. As no mortgage was used, these figures should be the same."
mortgage_used_socialhomebuy:"The mortgage, deposit and cash discount added together is %{mortgage_deposit_and_discount_total} and the percentage bought times the purchase price is %{stairbought_part_of_value}. These figures should be the same."
mortgage_not_used_socialhomebuy:"The deposit and cash discount added together is %{deposit_and_discount_total} and the percentage bought times the purchase price is %{stairbought_part_of_value}. As no mortgage was used, these figures should be the same."
stairowned:
mortgageused_dont_know:"The percentage owned has to be 100% if the mortgage used is 'Don’t know'"
@ -744,6 +744,38 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).toinclude("The mortgage and deposit added together is £15,000.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
expect(record.errors["deposit"]).toinclude("The mortgage and deposit added together is £15,000.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
expect(record.errors["equity"]).toinclude("The mortgage and deposit added together is £15,000.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
expect(record.errors["cashdis"]).not_toinclude("The mortgage and deposit added together is £15,000.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
expect(record.errors["value"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
expect(record.errors["equity"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
expect(record.errors["cashdis"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the purchase price times by the equity is £8,400.00. These figures should be the same.")
end
end
context"and it is not a shared ownership transaction"do
@ -758,6 +790,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).tobe_empty
expect(record.errors["deposit"]).tobe_empty
expect(record.errors["equity"]).tobe_empty
expect(record.errors["cashdis"]).tobe_empty
end
end
end
@ -771,6 +804,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).tobe_empty
expect(record.errors["deposit"]).tobe_empty
expect(record.errors["equity"]).tobe_empty
expect(record.errors["cashdis"]).tobe_empty
end
end
@ -791,6 +825,38 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).toinclude("The deposit is £5,000.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["deposit"]).toinclude("The deposit is £5,000.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["equity"]).toinclude("The deposit is £5,000.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["cashdis"]).not_toinclude("The deposit is £5,000.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["mortgageused"]).toinclude("The deposit and cash discount added together is £5,200.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["value"]).toinclude("The deposit and cash discount added together is £5,200.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["deposit"]).toinclude("The deposit and cash discount added together is £5,200.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["equity"]).toinclude("The deposit and cash discount added together is £5,200.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["cashdis"]).toinclude("The deposit and cash discount added together is £5,200.00 and the purchase price times by the equity is £8,400.00. As no mortgage was used, these figures should be the same.")
end
end
context"and it is not a shared ownership transaction"do
@ -805,6 +871,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).tobe_empty
expect(record.errors["deposit"]).tobe_empty
expect(record.errors["equity"]).tobe_empty
expect(record.errors["cashdis"]).tobe_empty
end
end
end
@ -818,6 +885,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).tobe_empty
expect(record.errors["deposit"]).tobe_empty
expect(record.errors["equity"]).tobe_empty
expect(record.errors["cashdis"]).tobe_empty
end
end
end
@ -833,6 +901,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).tobe_empty
expect(record.errors["deposit"]).tobe_empty
expect(record.errors["equity"]).tobe_empty
expect(record.errors["cashdis"]).tobe_empty
end
end
end
@ -864,6 +933,38 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).toinclude("The mortgage and deposit added together is £15,000.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
expect(record.errors["deposit"]).toinclude("The mortgage and deposit added together is £15,000.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
expect(record.errors["stairbought"]).toinclude("The mortgage and deposit added together is £15,000.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
expect(record.errors["cashdis"]).not_toinclude("The mortgage and deposit added together is £15,000.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
expect(record.errors["mortgage"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
expect(record.errors["value"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
expect(record.errors["deposit"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
expect(record.errors["stairbought"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
expect(record.errors["cashdis"]).toinclude("The mortgage, deposit and cash discount added together is £15,200.00 and the percentage bought times the purchase price is £8,400.00. These figures should be the same.")
end
end
context"and it is not a shared ownership transaction"do
@ -878,6 +979,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).tobe_empty
expect(record.errors["deposit"]).tobe_empty
expect(record.errors["stairbought"]).tobe_empty
expect(record.errors["cashdis"]).tobe_empty
end
end
end
@ -891,6 +993,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).tobe_empty
expect(record.errors["deposit"]).tobe_empty
expect(record.errors["stairbought"]).tobe_empty
expect(record.errors["cashdis"]).tobe_empty
end
end
end
@ -905,6 +1008,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).tobe_empty
expect(record.errors["deposit"]).tobe_empty
expect(record.errors["stairbought"]).tobe_empty
expect(record.errors["cashdis"]).tobe_empty
end
end
@ -928,6 +1032,38 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
expect(record.errors["value"]).toinclude("The deposit is £5,000.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["deposit"]).toinclude("The deposit is £5,000.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["stairbought"]).toinclude("The deposit is £5,000.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["cashdis"]).not_toinclude("The deposit is £5,000.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["mortgageused"]).toinclude("The deposit and cash discount added together is £5,200.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["value"]).toinclude("The deposit and cash discount added together is £5,200.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["deposit"]).toinclude("The deposit and cash discount added together is £5,200.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["stairbought"]).toinclude("The deposit and cash discount added together is £5,200.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
expect(record.errors["cashdis"]).toinclude("The deposit and cash discount added together is £5,200.00 and the percentage bought times the purchase price is £8,400.00. As no mortgage was used, these figures should be the same.")
end
end
context"and it is not a shared ownership transaction"do