diff --git a/app/helpers/question_attribute_helper.rb b/app/helpers/question_attribute_helper.rb index d292239d8..04f0ad4bc 100644 --- a/app/helpers/question_attribute_helper.rb +++ b/app/helpers/question_attribute_helper.rb @@ -10,6 +10,7 @@ module QuestionAttributeHelper private def numeric_question_html_attributes(question) + return { "style": "background-color: #f3f2f1;" } if question.read_only? return {} if question.fields_to_add.blank? || question.result_field.blank? { diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index 62fc65fbe..fa3c24efd 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -541,6 +541,23 @@ "requires_js": true } } + }, + "weekly_net_income": { + "header": "", + "description": "", + "questions": { + "earnings": { + "check_answer_label": "Total household income", + "header": "How much income does the household have in total every week?", + "hint_text": "", + "type": "numeric", + "min": 0, + "step": "1", + "width": 5, + "prefix": "£", + "suffix": " every week" + } + } } } } diff --git a/spec/helpers/question_attribute_helper_spec.rb b/spec/helpers/question_attribute_helper_spec.rb index 88c30d3e9..db3d60b84 100644 --- a/spec/helpers/question_attribute_helper_spec.rb +++ b/spec/helpers/question_attribute_helper_spec.rb @@ -7,7 +7,7 @@ RSpec.describe QuestionAttributeHelper do describe "html attributes" do it "returns empty hash if fields-to-add or result-field are empty " do - question = questions.find { |q| q.id == "tcharge" } + question = form.get_page("weekly_net_income").questions.find { |q| q.id == "earnings" } expect(stimulus_html_attributes(question)).to eq({}) end diff --git a/spec/models/form_handler_spec.rb b/spec/models/form_handler_spec.rb index e44785519..5d2d6843b 100644 --- a/spec/models/form_handler_spec.rb +++ b/spec/models/form_handler_spec.rb @@ -16,7 +16,7 @@ RSpec.describe FormHandler do form_handler = FormHandler.instance form = form_handler.get_form(test_form_name) expect(form).to be_a(Form) - expect(form.pages.count).to eq(28) + expect(form.pages.count).to eq(29) end end