Skip to content

Commit

Permalink
Fix flaky investments order spec
Browse files Browse the repository at this point in the history
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
  • Loading branch information
javierm committed Sep 1, 2021
1 parent 713ae54 commit ed3ad35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/system/budgets/investments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,13 @@
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)

Expand Down

0 comments on commit ed3ad35

Please sign in to comment.