Skip to content

Commit

Permalink
Add standard govuk error summary to form
Browse files Browse the repository at this point in the history
  • Loading branch information
AbigailMcP committed Sep 12, 2023
1 parent 071bd30 commit 8a56c33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/views/check_records/search/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<h1 class="govuk-heading-l">Find teacher record</h1>

<%= form_with model: @search, url: check_records_result_path, method: :get do |f| %>
<%= f.govuk_error_summary %>
<%= f.govuk_text_field :last_name, class: "govuk-input--width-20", label: { class: "govuk-label--s", text: "Last name" }, required: true %>

<%= f.govuk_date_field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
given_the_service_is_open
when_i_sign_in_via_dsi
and_press_find_record
then_i_see_the_error_summary
then_i_see_the_missing_name_error
then_i_see_the_missing_dob_error

Expand Down Expand Up @@ -39,6 +40,10 @@ def and_press_find_record
click_button "Find record"
end

def then_i_see_the_error_summary
expect(page).to have_content "There’s a problem"
end

def then_i_see_the_missing_dob_error
within "#search-date-of-birth-error" do
expect(page).to have_content "Error:"
Expand Down

0 comments on commit 8a56c33

Please sign in to comment.