diff --git a/app/helpers/interruption_screen_helper.rb b/app/helpers/interruption_screen_helper.rb index fc75f6f59..b28c7eaa9 100644 --- a/app/helpers/interruption_screen_helper.rb +++ b/app/helpers/interruption_screen_helper.rb @@ -1,5 +1,6 @@ module InterruptionScreenHelper def display_informative_text(informative_text, log) + return informative_text if informative_text.is_a? String return "" unless informative_text["arguments"] translation_params = {} diff --git a/app/models/form/lettings/pages/max_rent_value_check.rb b/app/models/form/lettings/pages/max_rent_value_check.rb index 8a1d0ee07..82aff8481 100644 --- a/app/models/form/lettings/pages/max_rent_value_check.rb +++ b/app/models/form/lettings/pages/max_rent_value_check.rb @@ -4,26 +4,13 @@ class Form::Lettings::Pages::MaxRentValueCheck < ::Form::Page @depends_on = [{ "rent_in_soft_max_range?" => true }] @title_text = { "translation" => "soft_validations.rent.outside_range_title", - "arguments" => [ - { - "key" => "brent", - "label" => true, - "i18n_template" => "brent", - }, - ], + "arguments" => [{ + "key" => "brent", + "label" => true, + "i18n_template" => "brent", + }], } - # @informative_text = {} - @informative_text = { - "translation" => "soft_validations.rent.max_hint_text", - "arguments" => [ - { - "key" => "field_formatted_as_currency", - "arguments_for_key" => "soft_max_for_period", - "i18n_template" => "soft_max_for_period", - }, - ], - } - + @informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "higher") @check_answers_card_number = check_answers_card_number end diff --git a/app/models/form/lettings/pages/min_rent_value_check.rb b/app/models/form/lettings/pages/min_rent_value_check.rb index 8e72fe8df..b2bae4e8e 100644 --- a/app/models/form/lettings/pages/min_rent_value_check.rb +++ b/app/models/form/lettings/pages/min_rent_value_check.rb @@ -10,7 +10,7 @@ class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page "i18n_template" => "brent", }], } - @informative_text = {} + @informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "lower") @check_answers_card_number = check_answers_card_number end diff --git a/config/locales/en.yml b/config/locales/en.yml index 6ff44bfb5..deb681735 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -595,8 +595,7 @@ en: over_soft_max_for_la_combined: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?" rent: outside_range_title: "You told us the rent is %{brent}" - min_hint_text: "This is lower than we would expect." - max_hint_text: "This is higher than we would expect." + informative_text: "This is %{higher_or_lower} than we would expect." hint_text: "Check the following:" purchase_price: title_text: "You told us the purchase price is %{value}" diff --git a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb index f7e5527a5..29f64ec5d 100644 --- a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb @@ -1028,7 +1028,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "populates with correct error message" do expect(parser.errors.where(:field_128, category: :soft_validation).count).to be(1) - expect(parser.errors.where(:field_128, category: :soft_validation).first.message).to eql("You told us the rent is £120.00 every week. The maximum rent expected for this type of property in this local authority is ££118.85 every week.") + expect(parser.errors.where(:field_128, category: :soft_validation).first.message).to eql("You told us the rent is £120.00 every week. This is higher than we would expect.") end end end