From eb16282a015708231871291253f2bf7ae0549b70 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 5 Aug 2025 17:50:55 +0200 Subject: [PATCH] Make spec thread safe... Something(???) has changed that Github Actions has become *so* fast that those hit now... --- spec/features/conference_registration_spec.rb | 7 +++---- spec/features/roles_spec.rb | 2 ++ spec/features/tickets_spec.rb | 6 ++---- spec/features/versions_spec.rb | 2 ++ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/spec/features/conference_registration_spec.rb b/spec/features/conference_registration_spec.rb index 4a9df4d8..3e7ba537 100644 --- a/spec/features/conference_registration_spec.rb +++ b/spec/features/conference_registration_spec.rb @@ -46,11 +46,10 @@ feature Registration do context 'who is not registered' do scenario 'registers for a conference', feature: true, js: true do - visit root_path - click_link 'Register' - - expect(current_path).to eq(new_conference_conference_registration_path(conference.short_title)) + visit new_conference_conference_registration_path(conference.short_title) click_button 'Register' + page.find('#flash') + expect(flash).to eq('You are now registered and will be receiving E-Mail notifications.') expect(conference.user_registered?(participant)).to be(true) end diff --git a/spec/features/roles_spec.rb b/spec/features/roles_spec.rb index 3bc34196..83377a19 100644 --- a/spec/features/roles_spec.rb +++ b/spec/features/roles_spec.rb @@ -58,6 +58,8 @@ feature Role do fill_in 'user_email', with: user_with_no_role.email click_button 'Add' + page.find('.alert') + user_with_no_role.reload expect(user_with_no_role.has_cached_role?(role.name, conference)).to be true diff --git a/spec/features/tickets_spec.rb b/spec/features/tickets_spec.rb index 047a4e38..cb881400 100644 --- a/spec/features/tickets_spec.rb +++ b/spec/features/tickets_spec.rb @@ -41,12 +41,10 @@ feature Ticket do click_button 'Update Ticket' - ticket.reload - # It's necessary to multiply by 100 because the price is in cents page.find('#flash') expect(flash).to eq('Ticket successfully updated.') - expect(ticket.price).to eq(Money.new(50 * 100, 'USD')) - expect(ticket.title).to eq('Event Ticket') + expect(ticket.reload.price.to_i).to eq(50) + expect(ticket.reload.title).to eq('Event Ticket') expect(Ticket.count).to eq(2) end diff --git a/spec/features/versions_spec.rb b/spec/features/versions_spec.rb index 9007e503..6ed5ea18 100644 --- a/spec/features/versions_spec.rb +++ b/spec/features/versions_spec.rb @@ -20,6 +20,8 @@ feature 'Version' do fill_in 'contact_social_tag', with: 'example' fill_in 'contact_googleplus', with: 'http:\\www.google.com' click_button 'Update Contact' + page.find('#flash') + expect(flash).to eq('Contact details were successfully updated.') visit admin_revision_history_path expect(page).to have_text("#{organizer.name} updated social tag, email, googleplus and sponsor email of contact details in conference #{conference.short_title}")