From 1593a150e769147a4cf238f0942a70f664c8cf32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 13 Mar 2025 12:21:16 +0100 Subject: [PATCH] Move in_browser expectations inside the same block This way the code is easier to follow, and we avoid having simultaneous requests on different browser sessions, which in theory shouldn't affect the application, but the test might be a bit more robust this way. --- spec/system/officing_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/system/officing_spec.rb b/spec/system/officing_spec.rb index 9458e3a0f..5ba7a6d2f 100644 --- a/spec/system/officing_spec.rb +++ b/spec/system/officing_spec.rb @@ -117,16 +117,18 @@ describe "Poll Officing" do in_browser(:one) do login_as officer1.user visit officing_root_path + + expect(page).to have_content "Here you can validate user documents and store voting results" end in_browser(:two) do login_as officer2.user visit officing_root_path + + expect(page).to have_content "Here you can validate user documents and store voting results" end in_browser(:one) do - expect(page).to have_content("Here you can validate user documents and store voting results") - visit new_officing_residence_path expect(page).to have_css "#residence_document_type" @@ -148,8 +150,6 @@ describe "Poll Officing" do end in_browser(:two) do - expect(page).to have_content("Here you can validate user documents and store voting results") - visit new_officing_residence_path expect(page).to have_css "#residence_document_type"