Browse Source

feat: more copy updates

CLDC-1790-sales-validation-content-updates
natdeanlewissoftwire 2 years ago
parent
commit
fb8494074b
  1. 2
      app/models/form/sales/questions/household_wheelchair_check.rb
  2. 4
      app/models/validations/sales/financial_validations.rb
  3. 4
      config/locales/en.yml
  4. 4
      spec/models/validations/sales/financial_validations_spec.rb

2
app/models/form/sales/questions/household_wheelchair_check.rb

@ -3,7 +3,7 @@ class Form::Sales::Questions::HouseholdWheelchairCheck < ::Form::Question
super
@id = "wheel_value_check"
@check_answer_label = "Does anyone in the household use a wheelchair?"
@header = "Are you sure? You said previously that somebody in household uses a wheelchair"
@header = "Is this right? Earlier, you said someone in the household uses a wheelchair"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

4
app/models/validations/sales/financial_validations.rb

@ -5,9 +5,9 @@ module Validations::Sales::FinancialValidations
def validate_income1(record)
if record.ecstat1 && record.income1 && record.ownershipsch == 1
if record.london_property?
record.errors.add :income1, I18n.t("validations.financial.income1.over_hard_max", hard_max: 90_000) if record.income1 > 90_000
record.errors.add :income1, I18n.t("validations.financial.income1.over_hard_max.inside_london") if record.income1 > 90_000
elsif record.income1 > 80_000
record.errors.add :income1, I18n.t("validations.financial.income1.over_hard_max", hard_max: 80_000)
record.errors.add :income1, I18n.t("validations.financial.income1.over_hard_max.outside_london")
end
end
end

4
config/locales/en.yml

@ -214,7 +214,9 @@ en:
freq_missing: "Select how often the household receives income"
earnings_missing: "Enter how much income the household has in total"
income1:
over_hard_max: "Income must be lower than £%{hard_max}"
over_hard_max:
outside_london: "Income maximum under £80,000 for properties outside London local authorities"
inside_london: "Income maximum £90,000 for properties within London local authorities"
negative_currency: "Enter an amount above 0"
rent:
less_than_shortfall: "Enter an amount that is more than the shortfall in basic rent"

4
spec/models/validations/sales/financial_validations_spec.rb

@ -16,7 +16,7 @@ RSpec.describe Validations::Sales::FinancialValidations do
record.ecstat1 = ecstat
financial_validator.validate_income1(record)
expect(record.errors["income1"])
.to include(match I18n.t("validations.financial.income1.over_hard_max", hard_max: 80_000))
.to include(match I18n.t("validations.financial.income1.over_hard_max.outside_london"))
end
end
@ -40,7 +40,7 @@ RSpec.describe Validations::Sales::FinancialValidations do
record.ecstat1 = ecstat
financial_validator.validate_income1(record)
expect(record.errors["income1"])
.to include(match I18n.t("validations.financial.income1.over_hard_max", hard_max: 90_000))
.to include(match I18n.t("validations.financial.income1.over_hard_max.inside_london"))
end
end

Loading…
Cancel
Save