From 5fcd52740787ebaa114052407ba75ad39fa4066c Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 6 Aug 2024 22:14:01 +0100 Subject: [PATCH] Update tests --- .../sale_information_validations_spec.rb | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/spec/models/validations/sales/sale_information_validations_spec.rb b/spec/models/validations/sales/sale_information_validations_spec.rb index 41b1d842d..1c4ded586 100644 --- a/spec/models/validations/sales/sale_information_validations_spec.rb +++ b/spec/models/validations/sales/sale_information_validations_spec.rb @@ -868,12 +868,12 @@ RSpec.describe Validations::Sales::SaleInformationValidations do it "adds an error" do sale_information_validator.validate_non_staircasing_mortgage(record) - expect(record.errors["mortgage"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["value"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["deposit"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["equity"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["type"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["cashdis"]).not_to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") + expect(record.errors["mortgage"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["value"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["deposit"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["equity"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["type"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["cashdis"]).not_to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") end context "and it is a social homebuy" do @@ -884,12 +884,12 @@ RSpec.describe Validations::Sales::SaleInformationValidations do it "adds an error" do sale_information_validator.validate_non_staircasing_mortgage(record) - expect(record.errors["mortgage"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") - expect(record.errors["value"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") - expect(record.errors["deposit"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") - expect(record.errors["equity"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") - expect(record.errors["cashdis"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") - expect(record.errors["type"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["mortgage"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["value"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["deposit"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["equity"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["cashdis"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") + expect(record.errors["type"]).to include("The mortgage amount (£10,000.00), deposit (£5,000.00), and cash discount (£200.00) added together is £15,200.00.

The full purchase price (£30,000.00) multiplied by the percentage equity stake purchased (28.0%) is £8,400.00.

These two amounts should be the same.") end end @@ -968,12 +968,12 @@ RSpec.describe Validations::Sales::SaleInformationValidations do it "adds an error" do sale_information_validator.validate_non_staircasing_mortgage(record) - expect(record.errors["mortgageused"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["value"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["deposit"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["equity"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["type"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["cashdis"]).not_to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") + expect(record.errors["mortgageused"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["value"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["deposit"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["equity"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["type"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["cashdis"]).not_to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") end context "and it is a social homebuy" do @@ -1087,12 +1087,12 @@ RSpec.describe Validations::Sales::SaleInformationValidations do it "adds an error" do sale_information_validator.validate_staircasing_mortgage(record) - expect(record.errors["mortgage"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["value"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["deposit"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["stairbought"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["type"]).to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["cashdis"]).not_to include("The mortgage and deposit added together is £15,000.00. The value multiplied by the percentage bought is £8,400.00. These figures should be the same.") + expect(record.errors["mortgage"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["value"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["deposit"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["stairbought"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["type"]).to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["cashdis"]).not_to include("The mortgage (£10,000.00) and deposit (£5,000.00) added together is £15,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") end context "and it is a social homebuy" do @@ -1206,12 +1206,12 @@ RSpec.describe Validations::Sales::SaleInformationValidations do it "adds an error" do sale_information_validator.validate_staircasing_mortgage(record) - expect(record.errors["mortgageused"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["value"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["deposit"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["stairbought"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["type"]).to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") - expect(record.errors["cashdis"]).not_to include("The deposit is £5,000.00 and the value multiplied by the percentage bought is £8,400.00. These figures should be the same.") + expect(record.errors["mortgageused"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["value"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["deposit"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["stairbought"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["type"]).to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") + expect(record.errors["cashdis"]).not_to include("The deposit is £5,000.00.

The full purchase price (£30,000.00) multiplied by the percentage bought is £8,400.00.

These two amounts should be the same.") end context "and it is a social homebuy" do