Fix flaky hidden budget investments spec
The test was failing sometimes because the conditions we were checking were the same before and after clicking the "Pending" link. So there was a race condition between the request generated by clicking the "Pending" link and the order to click the "Confirm moderation" link. This sometimes resulted in the "Confirm moderation" link not being correctly clicked.
This commit is contained in:
@@ -31,7 +31,9 @@ describe "Admin hidden budget investments", :admin do
|
||||
investment = create(:budget_investment, :hidden, heading: heading)
|
||||
visit admin_hidden_budget_investments_path
|
||||
|
||||
click_link("Pending")
|
||||
click_link "Pending"
|
||||
|
||||
expect(page).not_to have_link "Pending"
|
||||
expect(page).to have_content(investment.title)
|
||||
|
||||
click_link "Confirm moderation"
|
||||
|
||||
Reference in New Issue
Block a user