Browse Source

Update validation message: discount

pull/1584/head
Kat 3 years ago
parent
commit
4699eca1e3
  1. 5
      app/models/form/sales/pages/percentage_discount_value_check.rb
  2. 3
      config/locales/en.yml
  3. 5
      spec/models/form/sales/pages/percentage_discount_value_check_spec.rb

5
app/models/form/sales/pages/percentage_discount_value_check.rb

@ -5,7 +5,10 @@ class Form::Sales::Pages::PercentageDiscountValueCheck < ::Form::Page
"translation" => "soft_validations.percentage_discount_value.title_text",
"arguments" => [{ "key" => "discount", "label" => true, "i18n_template" => "discount" }],
}
@informative_text = {}
@informative_text = {
"translation" => "soft_validations.percentage_discount_value.hint_text",
"arguments" => [],
}
@depends_on = [{ "percentage_discount_invalid?" => true }]
end

3
config/locales/en.yml

@ -580,7 +580,8 @@ en:
title_text: "You told us that buyer 2 will not live in the property."
hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property."
percentage_discount_value:
title_text: "You told us that the percentage discount was %{discount}. This seems high for this type of property."
title_text: "You told us that the percentage discount is %{discount}."
hint_text: "This is higher than we would expect."
savings:
title_text: "You told us the buyer’s savings were %{savings}."
hint_text: "This is higher than we would expect."

5
spec/models/form/sales/pages/percentage_discount_value_check_spec.rb

@ -31,7 +31,10 @@ RSpec.describe Form::Sales::Pages::PercentageDiscountValueCheck, type: :model do
end
it "has the correct informative_text" do
expect(page.informative_text).to eq({})
expect(page.informative_text).to eq({
"translation" => "soft_validations.percentage_discount_value.hint_text",
"arguments" => [],
})
end
it "is interruption screen page" do

Loading…
Cancel
Save