diff --git a/app/views/check_records/search/new.html.erb b/app/views/check_records/search/new.html.erb index d8f3a692..44f8497e 100644 --- a/app/views/check_records/search/new.html.erb +++ b/app/views/check_records/search/new.html.erb @@ -5,6 +5,7 @@

Find teacher record

<%= 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( diff --git a/spec/system/check_records/user_searches_with_invalid_values_spec.rb b/spec/system/check_records/user_searches_with_invalid_values_spec.rb index e69cadb3..e85e124d 100644 --- a/spec/system/check_records/user_searches_with_invalid_values_spec.rb +++ b/spec/system/check_records/user_searches_with_invalid_values_spec.rb @@ -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 @@ -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:"