-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'No teachers found' content and link back to search page
- Loading branch information
1 parent
f438556
commit bbb3074
Showing
3 changed files
with
63 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
spec/system/check_records/user_searches_with_no_matches_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "No matches", host: :check_records, type: :system do | ||
include ActivateFeaturesSteps | ||
include CheckRecords::AuthenticationSteps | ||
|
||
scenario "User searches with a last name and date of birth and finds no matches", | ||
test: %i[with_stubbed_auth with_fake_quals_api] do | ||
given_the_service_is_open | ||
when_i_sign_in_via_dsi | ||
and_search_returns_no_records | ||
then_i_see_no_records | ||
end | ||
|
||
private | ||
|
||
def and_search_returns_no_records | ||
fill_in "Last name", with: "No match" | ||
fill_in "Day", with: "1" | ||
fill_in "Month", with: "1" | ||
fill_in "Year", with: "1990" | ||
click_button "Find record" | ||
end | ||
|
||
def then_i_see_no_records | ||
expect(page).to have_content("No teachers found") | ||
expect(page).to have_link("Try another search") | ||
end | ||
end |