Fix flaky investments order spec
We were clicking links and visiting pages without checking the previous request had already finished. This might cause concurrent requests, leading to unpredictable results. It might be the reason why this test failed once when running our continuous integration [1]. [1] https://github.com/consul/consul/runs/3295502777
This commit is contained in:
@@ -297,8 +297,13 @@ describe "Budget Investments" do
|
||||
expect(order).not_to be_empty
|
||||
|
||||
click_link "highest rated"
|
||||
|
||||
expect(page).to have_css "h2", exact_text: "highest rated"
|
||||
|
||||
click_link "random"
|
||||
|
||||
expect(page).to have_css "h2", exact_text: "random"
|
||||
|
||||
visit budget_investments_path(budget, heading_id: heading.id)
|
||||
new_order = all(".budget-investment h3").map(&:text)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user