Browse Source

Update validation message: purchase price

pull/1584/head
Kat 3 years ago
parent
commit
9ea1863df6
  1. 4
      app/models/form/sales/pages/about_price_value_check.rb
  2. 4
      app/models/validations/sales/soft_validations.rb
  3. 2
      config/locales/en.yml
  4. 4
      spec/models/form/sales/pages/about_price_value_check_spec.rb

4
app/models/form/sales/pages/about_price_value_check.rb

@ -25,8 +25,8 @@ class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page
"i18n_template" => "soft_min_or_soft_max",
},
{
"key" => "purchase_price_min_or_max_text",
"i18n_template" => "min_or_max",
"key" => "purchase_price_higher_or_lower_text",
"i18n_template" => "higher_or_lower",
},
],
}

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

@ -82,8 +82,8 @@ module Validations::Sales::SoftValidations
saledate - hodate >= 3.years
end
def purchase_price_min_or_max_text
value < sale_range.soft_min ? "minimum" : "maximum"
def purchase_price_higher_or_lower_text
value < sale_range.soft_min ? "lower" : "higher"
end
def purchase_price_soft_min_or_soft_max

2
config/locales/en.yml

@ -532,7 +532,7 @@ en:
max_hint_text: "The maximum rent expected for this type of property in this local authority is %{soft_max_for_period}."
purchase_price:
title_text: "You told us the purchase price is %{value}"
hint_text: "The %{min_or_max} purchase price expected for this type of property in this local authority is %{soft_min_or_soft_max}"
hint_text: "This is %{higher_or_lower} than we would expect"
retirement:
min:
title: "You told us this person is under %{age} and retired"

4
spec/models/form/sales/pages/about_price_value_check_spec.rb

@ -45,8 +45,8 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do
"i18n_template" => "soft_min_or_soft_max",
},
{
"key" => "purchase_price_min_or_max_text",
"i18n_template" => "min_or_max",
"key" => "purchase_price_higher_or_lower_text",
"i18n_template" => "higher_or_lower",
},
],
})

Loading…
Cancel
Save