From 25bc4f11034d869cd1159b9b0cd4017e86413151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 26 Feb 2020 17:22:51 +0100 Subject: [PATCH] Fix flaky unselecting an investment spec In this spec, we were doing to request at the same time; one to unselect an investment and another one to filter the investments. If the second request finished before the first one, the test failed. Adding an expectation to check the first request has finished before the second one starts solves the problem. --- spec/features/admin/budget_investments_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb index d500719e0..97db505dd 100644 --- a/spec/features/admin/budget_investments_spec.rb +++ b/spec/features/admin/budget_investments_spec.rb @@ -1525,6 +1525,8 @@ describe "Admin budget investments" do within("#budget_investment_#{selected_bi.id}") do click_link("Selected") + + expect(page).to have_link("Select") end click_button("Filter")