diff --git a/app/views/form/_interruption_screen_question.html.erb b/app/views/form/_interruption_screen_question.html.erb index 5a6f7ee58..8071bf539 100644 --- a/app/views/form/_interruption_screen_question.html.erb +++ b/app/views/form/_interruption_screen_question.html.erb @@ -2,9 +2,8 @@ title_text: title_text, classes: 'app-panel--interruption', ) do %> - <% translation_question = case_log.form.get_question(informative_text["argument"]) %> - <% binding.pry %> - <%= I18n.t(informative_text["translation"], informative_text["argument"].to_sym => translation_question.answer_label(case_log)) %> + <% translation_question = informative_text["argument"].map {|x| case_log.form.get_question(x)} %> + <%= I18n.t(informative_text["translation"], informative_text["argument"][0].to_sym => translation_question[0].answer_label(case_log), informative_text["argument"][1].to_sym => translation_question[1].answer_label(case_log)) %> <%= f.govuk_radio_buttons_fieldset question.id.to_sym, legend: legend(question, page_header, conditional), hint: { text: question.hint_text&.html_safe } do %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f0b3b8020..becee6dca 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -144,7 +144,7 @@ en: soft_validations: net_income: - hint_text: "This is based on the tenant’s work situation: %{ecstat1}" + hint_text: "This is based on the tenant’s work situation: %{ecstat1}\nThe household income you have entered is %{earnings}" in_soft_min_range: message: "Net income is lower than expected based on the main tenant’s working situation. Are you sure this is correct?" in_soft_max_range: diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb index 3a29fe7da..ba66e2814 100644 --- a/spec/features/form/validations_spec.rb +++ b/spec/features/form/validations_spec.rb @@ -132,7 +132,7 @@ RSpec.describe "validations" do expect(page).to have_current_path("/logs/#{case_log.id}/net-income-value-check") expect(page).to have_content("Net income is higher than expected based on the main tenant’s working situation") expect(page).to have_content("This is based on the tenant’s work situation: Full-time – 30 hours or more") - expect(page).to have_content("The household income you have entered is £750 every week") + expect(page).to have_content("The household income you have entered is £750.00 every week") choose("case-log-net-income-value-check-0-field", allow_label_click: true) click_button("Save and continue") expect(page).to have_current_path("/logs/#{case_log.id}/net-income-uc-proportion") diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index b2eaec6ec..3720eaa92 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -542,7 +542,7 @@ "title_text": "Net income is higher than expected based on the main tenant’s working situation", "informative_text": { "translation": "soft_validations.net_income.hint_text", - "argument": "ecstat1" + "argument": ["ecstat1", "earnings"] }, "questions": { "net_income_value_check": {