diff --git a/app/models/form/page.rb b/app/models/form/page.rb
index c917d71ff..6542a6ff6 100644
--- a/app/models/form/page.rb
+++ b/app/models/form/page.rb
@@ -1,6 +1,6 @@
class Form::Page
attr_accessor :id, :header, :description, :questions, :soft_validations,
- :depends_on, :title_text, :subsection, :hide_subsection_label
+ :depends_on, :title_text, :informative_text, :subsection, :hide_subsection_label
def initialize(id, hsh, subsection)
@id = id
@@ -9,6 +9,7 @@ class Form::Page
@questions = hsh["questions"].map { |q_id, q| Form::Question.new(q_id, q, self) }
@depends_on = hsh["depends_on"]
@title_text = hsh["title_text"]
+ @informative_text = hsh["informative_text"]
@hide_subsection_label = hsh["hide_subsection_label"]
@soft_validations = hsh["soft_validations"]&.map { |sv_id, s| Form::Question.new(sv_id, s, self) }
@subsection = subsection
diff --git a/app/views/form/_interruption_screen_question.html.erb b/app/views/form/_interruption_screen_question.html.erb
index 8cdcbd991..5a6f7ee58 100644
--- a/app/views/form/_interruption_screen_question.html.erb
+++ b/app/views/form/_interruption_screen_question.html.erb
@@ -2,10 +2,12 @@
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)) %>
<%= f.govuk_radio_buttons_fieldset question.id.to_sym,
legend: legend(question, page_header, conditional),
hint: { text: question.hint_text&.html_safe } do %>
-
<% question.answer_options.map do |key, options| %>
<% if key.starts_with?("divider") %>
<%= f.govuk_radio_divider %>
diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb
index 9c7ab4b4f..48a005aaf 100644
--- a/app/views/form/page.html.erb
+++ b/app/views/form/page.html.erb
@@ -39,7 +39,7 @@
<% end %>
<% if question.type == "interruption_screen" %>
- <%= render partial: "form/#{question.type}_question", locals: { question: question, caption_text: @subsection.label, page_header: @page.header, case_log: @case_log, title_text: @page.title_text, f: f, conditional: false } %>
+ <%= render partial: "form/#{question.type}_question", locals: { question: question, caption_text: @subsection.label, page_header: @page.header, case_log: @case_log, title_text: @page.title_text, informative_text: @page.informative_text, form: @form, f: f, conditional: false } %>
<% else %>
<%= render partial: "form/#{question.type}_question", locals: { question: question, caption_text: @subsection.label, page_header: @page.header, case_log: @case_log, f: f, conditional: false } %>
<% end %>
diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb
index 1b7e7a95a..3a29fe7da 100644
--- a/spec/features/form/validations_spec.rb
+++ b/spec/features/form/validations_spec.rb
@@ -130,7 +130,9 @@ RSpec.describe "validations" do
choose("case-log-incfreq-0-field", allow_label_click: true)
click_button("Save and continue")
expect(page).to have_current_path("/logs/#{case_log.id}/net-income-value-check")
- expect(page).to have_content("Net income value outside expected range")
+ 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")
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 5cc545ace..b2eaec6ec 100644
--- a/spec/fixtures/forms/2021_2022.json
+++ b/spec/fixtures/forms/2021_2022.json
@@ -64,6 +64,56 @@
}
}
},
+ "person_1_working_situation": {
+ "header": "",
+ "description": "",
+ "questions": {
+ "ecstat1": {
+ "check_answer_label": "Lead tenant’s working situation",
+ "header": "Which of these best describes the lead tenant’s working situation?",
+ "hint_text": "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.",
+ "type": "radio",
+ "answer_options": {
+ "0": {
+ "value": "Part-time – Less than 30 hours"
+ },
+ "1": {
+ "value": "Full-time – 30 hours or more"
+ },
+ "2": {
+ "value": "Full-time student"
+ },
+ "3": {
+ "value": "In government training into work, such as New Deal"
+ },
+ "4": {
+ "value": "Jobseeker"
+ },
+ "5": {
+ "value": "Not seeking work"
+ },
+ "6": {
+ "value": "Unable to work because of long term sick or disability"
+ },
+ "7": {
+ "value": "Retired"
+ },
+ "8": {
+ "value": "Child under 16"
+ },
+ "9": {
+ "value": "Other"
+ },
+ "divider": {
+ "value": true
+ },
+ "10": {
+ "value": "Tenant prefers not to say"
+ }
+ }
+ }
+ }
+ },
"household_number_of_other_members": {
"questions": {
"other_hhmemb": {
@@ -489,12 +539,16 @@
},
"net_income_value_check": {
"depends_on": [{ "net_income_soft_validation_triggered?": true }],
- "title_text": "Net income value outside expected range",
+ "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"
+ },
"questions": {
"net_income_value_check": {
"check_answer_label": "Net income soft validation",
"hidden_in_check_answers": true,
- "header": "Is this value correct?",
+ "header": "Are you sure this is correct?",
"type": "interruption_screen",
"answer_options": {
"0": {