This commit is contained in:
Mridankan Mandal 2026-08-12 02:48:13 +08:00 committed by GitHub
commit 08eded271e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -164,9 +164,14 @@ feature Event do
visit conference_program_proposals_path(conference.short_title) visit conference_program_proposals_path(conference.short_title)
expect(page).to have_content 'Example Proposal' expect(page).to have_content 'Example Proposal'
expect(@event.state).to eq('unconfirmed') 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(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 @event.reload
expect(@event.state).to eq('confirmed') expect(@event.state).to eq('confirmed')
end end