From b37ea4d253d0ea9f6520805bfc70f1a5c254b589 Mon Sep 17 00:00:00 2001 From: Arthur Campbell Date: Tue, 31 Jan 2023 12:04:02 +0000 Subject: [PATCH] amend minor typo, add back a soft validation that had mysteriously gone missing --- .../form/sales/pages/shared_ownership_deposit_value_check.rb | 2 +- config/locales/en.yml | 3 ++- .../sales/pages/shared_ownership_deposit_value_check_spec.rb | 2 +- spec/models/validations/shared_validations_spec.rb | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb b/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb index 907968028..be2126482 100644 --- a/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb +++ b/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb @@ -8,7 +8,7 @@ class Form::Sales::Pages::SharedOwnershipDepositValueCheck < ::Form::Page ] @informative_text = {} @title_text = { - "translation" => "soft_validations.shared_owhership_deposit.title_text", + "translation" => "soft_validations.shared_ownership_deposit.title_text", "arguments" => [ { "key" => "expected_shared_ownership_deposit_value", diff --git a/config/locales/en.yml b/config/locales/en.yml index 9a659b542..4404c7840 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -468,9 +468,10 @@ en: title_text: "You told us the time between the start of the tenancy and the major repairs completion date is more than 2 years" void_date: title_text: "You told us the time between the start of the tenancy and the void date is more than 2 years" - shared_owhership_deposit: + shared_ownership_deposit: title_text: "Mortgage, deposit and cash discount total should equal £%{expected_shared_ownership_deposit_value}" old_persons_shared_ownership: "At least one buyer should be aged over 64 for Older persons’ shared ownership scheme" + staircase_bought_seems_high: "You said %{percentage}% was bought in this staircasing transaction, which seems high. Are you sure?" devise: two_factor_authentication: diff --git a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb index afe25f4d3..893a5cb5b 100644 --- a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb @@ -33,7 +33,7 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.shared_owhership_deposit.title_text", + "translation" => "soft_validations.shared_ownership_deposit.title_text", "arguments" => [ { "key" => "expected_shared_ownership_deposit_value", diff --git a/spec/models/validations/shared_validations_spec.rb b/spec/models/validations/shared_validations_spec.rb index ced0505ad..151050d8b 100644 --- a/spec/models/validations/shared_validations_spec.rb +++ b/spec/models/validations/shared_validations_spec.rb @@ -86,7 +86,7 @@ RSpec.describe Validations::SharedValidations do context "when validating price" do it "validates that £ prefix and , is added in the error message" do - sales_record.income1 = "random" + sales_record.income1 = -5 shared_validator.validate_numeric_min_max(sales_record) expect(sales_record.errors["income1"]) .to include(match I18n.t("validations.numeric.within_range", field: "Buyer 1’s gross annual income", min: "£0", max: "£999,999"))