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:
Javi Martín
2021-06-14 01:52:45 +02:00
parent 59ee3d1215
commit 8b8b1b7a43

View File

@@ -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"