From 84cee86db645da68939ffc831e9f91a59ce904bd Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 29 Oct 2021 09:45:54 +0100 Subject: [PATCH] Add error indication --- .../_validation_override_question.html.erb | 18 ++++++++++-------- spec/features/case_log_spec.rb | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/views/form/_validation_override_question.html.erb b/app/views/form/_validation_override_question.html.erb index e1858ecb2..d893c53a4 100644 --- a/app/views/form/_validation_override_question.html.erb +++ b/app/views/form/_validation_override_question.html.erb @@ -1,9 +1,11 @@ -<%= f.govuk_check_boxes_fieldset :override_net_income_validation, - legend: { text: @case_log.soft_errors.values.first.message, size: "l" }, - hint: { text: @case_log.soft_errors.values.first.hint_text } do %> +
+ <%= f.govuk_check_boxes_fieldset :override_net_income_validation, + legend: { text: @case_log.soft_errors.values.first.message, size: "l" }, + hint: { text: @case_log.soft_errors.values.first.hint_text } do %> - <%= f.govuk_check_box :override_net_income_validation, "override_net_income_validation", - label: { text: "Yes" }, - checked: f.object.send("override_net_income_validation") - %> -<% end %> + <%= f.govuk_check_box :override_net_income_validation, "override_net_income_validation", + label: { text: "Yes" }, + checked: f.object.send("override_net_income_validation") + %> + <% end %> +
diff --git a/spec/features/case_log_spec.rb b/spec/features/case_log_spec.rb index e59360513..f9be0f516 100644 --- a/spec/features/case_log_spec.rb +++ b/spec/features/case_log_spec.rb @@ -388,7 +388,7 @@ RSpec.describe "Test Features" do fill_in("case-log-net-income-field", with: income_over_soft_limit) choose("case-log-net-income-frequency-weekly-field", allow_label_click: true) click_button("Save and continue") - expect(page).to have_content("For net incomes that fall outside the expected range you must confirm they're correct") + expect(page).to have_content("Are you sure this is correct?") check("case-log-override-net-income-validation-override-net-income-validation-field", allow_label_click: true) click_button("Save and continue") expect(page).to have_current_path("/case_logs/#{case_log.id}/net_income_uc_proportion") @@ -414,7 +414,7 @@ RSpec.describe "Test Features" do fill_in("case-log-net-income-field", with: income_under_soft_limit) click_button("Save and continue") click_link(text: "Back") - expect(page).not_to have_content("For net incomes that fall outside the expected range you must confirm they're correct") + expect(page).not_to have_content("Are you sure this is correct?") end end end