From ea2f602d79d753165e5497233cf5ac46e8a27468 Mon Sep 17 00:00:00 2001 From: Klaus Zanders Date: Fri, 20 Mar 2026 14:59:39 +0100 Subject: [PATCH] Use new helpers in flaky specs to properly wait for turbo --- spec/features/projects/favorite_spec.rb | 4 +++- spec/features/projects/persisted_lists_sharing_spec.rb | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/features/projects/favorite_spec.rb b/spec/features/projects/favorite_spec.rb index 33b85b4a4da..92d5223d5be 100644 --- a/spec/features/projects/favorite_spec.rb +++ b/spec/features/projects/favorite_spec.rb @@ -61,7 +61,9 @@ RSpec.describe "Favorite projects", :js do visit project_path(project) expect(page).to have_css "a", accessible_name: "Add to favorites" - click_link_or_button(accessible_name: "Add to favorites") + wait_for_turbo do + click_link_or_button(accessible_name: "Add to favorites") + end expect(page).to have_css "a", accessible_name: "Remove from favorites" diff --git a/spec/features/projects/persisted_lists_sharing_spec.rb b/spec/features/projects/persisted_lists_sharing_spec.rb index 0e98ad4619d..e8bd07d98db 100644 --- a/spec/features/projects/persisted_lists_sharing_spec.rb +++ b/spec/features/projects/persisted_lists_sharing_spec.rb @@ -366,13 +366,11 @@ RSpec.describe "Project list sharing", # Toggle the switch to make the project list query public share_dialog.expect_toggle_public_off - share_dialog.toggle_public - - retry_block do - # dialog body is replaced on toggle by turbo stream, we have to wait for the render to be completed so we - # retry the expectation until the toggle is on again - share_dialog.expect_toggle_public_on + wait_for_turbo_stream do + share_dialog.toggle_public end + + share_dialog.expect_toggle_public_on share_dialog.close # Reopen the dialog and expect the public state to be kept