Don't click two places at the same time
When clicking the button "Search", the link "newest" is already present, so capybara might click the "newest" link before the "Search" request is finished, leading to unexpected results. Checking the page to make sure the "Search" request has finished before clicking the "newest" link solves the problem.
This commit is contained in:
@@ -1478,7 +1478,11 @@ describe "Proposals" do
|
||||
visit proposals_path
|
||||
fill_in "search", with: "Show what you got"
|
||||
click_button "Search"
|
||||
|
||||
expect(page).to have_content "Search results"
|
||||
|
||||
click_link "newest"
|
||||
|
||||
expect(page).to have_selector("a.is-active", text: "newest")
|
||||
|
||||
within("#proposals") do
|
||||
|
||||
Reference in New Issue
Block a user