From 207271e1c093c3a3ede7a8a4c3c99af9d77520c9 Mon Sep 17 00:00:00 2001 From: Mridankan Mandal Date: Thu, 18 Jun 2026 20:50:54 +0530 Subject: [PATCH] test: stabilize proposal confirmation spec Signed-off-by: Mridankan Mandal --- spec/features/proposals_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 64cd69f8..546d6617 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -164,9 +164,14 @@ feature Event do visit conference_program_proposals_path(conference.short_title) expect(page).to have_content 'Example Proposal' expect(@event.state).to eq('unconfirmed') - click_link "confirm_proposal_#{@event.id}" + expect(page).to have_selector("#confirm_proposal_#{@event.id}") + + # Clicking the rails-ujs patch link through Selenium can raise a stale + # node error after the redirect already happened, so trigger the click in + # the page context instead. + page.execute_script(%{ document.getElementById('confirm_proposal_#{@event.id}').click(); }) expect(page).to have_content 'The proposal was confirmed. Please register to attend the conference.' - expect(current_path).to eq(new_conference_conference_registration_path(conference.short_title)) + expect(page).to have_current_path(new_conference_conference_registration_path(conference.short_title)) @event.reload expect(@event.state).to eq('confirmed') end