From 9a8536b1fcc0bf79001ec27f4b1f76f14a33a7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 2 Jun 2022 18:44:46 +0200 Subject: [PATCH] Avoid simultaneous requests in moderation test We were clicking on the "Sign in" link right after clicking on the "Sign out" link, which might result in simultaneous requests and exceptions when running our test suite. So we're adding an expectation to make sure the first request has finished before starting the following one. --- spec/system/moderation/users_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/system/moderation/users_spec.rb b/spec/system/moderation/users_spec.rb index cf712de18..ce9eed9ec 100644 --- a/spec/system/moderation/users_spec.rb +++ b/spec/system/moderation/users_spec.rb @@ -38,7 +38,9 @@ describe "Moderate users" do expect(page).not_to have_content(comment3.body) - click_link("Sign out") + click_link "Sign out" + + expect(page).to have_content "You have been signed out successfully" visit root_path