add test for booths search

This commit is contained in:
DenisNikolski
2019-09-13 23:31:00 +03:00
parent 54c4a8d34b
commit 5627c8ccf4
5 changed files with 24 additions and 6 deletions

View File

@@ -123,4 +123,22 @@ describe "Admin booths" do
click_link "Go back"
expect(page).to have_current_path(available_admin_booths_path)
end
scenario "Search" do
booth = create(:poll_booth)
visit admin_booths_path
fill_in "search", with: booth.name
click_button "Search"
expect(page).to have_css(".booth", count: 1)
fill_in "search", with: booth.location
click_button "Search"
expect(page).to have_css(".booth", count: 1)
fill_in "search", with: "Wrong search criteria"
click_button "Search"
expect(page).to have_content "There are no active booths for any upcoming poll."
end
end

View File

@@ -48,7 +48,7 @@ describe "Admin shifts" do
click_link "Manage shifts"
end
expect(page).to have_content "git This booth has no shifts"
expect(page).to have_content "This booth has no shifts"
fill_in "search", with: officer.email
click_button "Search"