diff --git a/spec/features/admin/manage_workshop_attendances_spec.rb b/spec/features/admin/manage_workshop_attendances_spec.rb index 84ad89d6a..9e2192e14 100644 --- a/spec/features/admin/manage_workshop_attendances_spec.rb +++ b/spec/features/admin/manage_workshop_attendances_spec.rb @@ -24,6 +24,7 @@ scenario 'can remove a member from the attendee list' do visit admin_workshop_path(workshop) + expect(page).to have_css('.cancel_attendance', wait: 5) find('.cancel_attendance').click expect(page).to have_content('0 are attending as students') diff --git a/spec/features/listing_coaches_spec.rb b/spec/features/listing_coaches_spec.rb index 716c089d8..cf94e1382 100644 --- a/spec/features/listing_coaches_spec.rb +++ b/spec/features/listing_coaches_spec.rb @@ -1,8 +1,10 @@ RSpec.feature 'when visiting the coaches page', type: :feature do scenario 'I can see the most active coaches' do - coach = Fabricate(:attended_coach).member + # Use a past workshop date in the current year to ensure the coach is counted + workshop = Fabricate(:workshop, date_and_time: Time.zone.today.beginning_of_year + 1.month) + coach = Fabricate(:attended_coach, workshop: workshop).member visit coaches_path - expect(page).to have_content coach.name + expect(page).to have_content(coach.name, wait: 5) end scenario 'I can see the top coaches by year' do