Browse Source

Add error indication

pull/72/head
baarkerlounger 4 years ago
parent
commit
84cee86db6
  1. 2
      app/views/form/_validation_override_question.html.erb
  2. 4
      spec/features/case_log_spec.rb

2
app/views/form/_validation_override_question.html.erb

@ -1,3 +1,4 @@
<div class="govuk-form-group govuk-form-group--error">
<%= 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 %>
@ -7,3 +8,4 @@
checked: f.object.send("override_net_income_validation")
%>
<% end %>
</div>

4
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

Loading…
Cancel
Save