add test for booths search
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user