From 5d1930efcd46f8febbdbc4efb881f9d1537ceb30 Mon Sep 17 00:00:00 2001 From: artfuldev Date: Sat, 12 Sep 2026 00:56:40 +0100 Subject: [PATCH 1/3] Fix event edit form dropping organisers on save --- app/views/admin/events/_form.html.haml | 2 +- spec/features/admin/manage_event_spec.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/admin/events/_form.html.haml b/app/views/admin/events/_form.html.haml index 231089153..59efdc084 100644 --- a/app/views/admin/events/_form.html.haml +++ b/app/views/admin/events/_form.html.haml @@ -46,7 +46,7 @@ .col-12.col-md-6.col-lg-4 = f.association :gold_sponsors, input_html: { data: { placeholder: 'Select gold sponsors' }}, collection: all_sponsors .col-12 - = f.input :organisers, collection: all_managers, value_method: :id, label_method: :full_name, selected: @event.organisers.pluck(&:id), input_html: { multiple: true } + = f.input :organisers, collection: all_managers, value_method: :id, label_method: :full_name, selected: @event.organisers.pluck(:id), input_html: { multiple: true } .col-12 = f.input :announce_only, as: :boolean, hint: 'Events where invitations are not handled via our application' .col-12 diff --git a/spec/features/admin/manage_event_spec.rb b/spec/features/admin/manage_event_spec.rb index 6f6170eed..a66e21ecd 100644 --- a/spec/features/admin/manage_event_spec.rb +++ b/spec/features/admin/manage_event_spec.rb @@ -33,6 +33,15 @@ expect(event.reload.chapter_ids).to match_array(Chapter.ids) end + scenario 'editing an event keeps its existing organisers' do + visit edit_admin_event_path(event) + + click_on 'Save' + + expect(page).to have_text('You have just updated the event') + expect(event.reload.organisers).to include(member) + end + scenario 'verifying an attendance' do invitation = Fabricate(:invitation, event:, attending: true) visit admin_event_path(event) From 34d85dc5dc6cced92e75368f301838fb280a9ebb Mon Sep 17 00:00:00 2001 From: artfuldev Date: Sat, 12 Sep 2026 01:11:37 +0100 Subject: [PATCH 2/3] Scope chapters search-choice assertion to the chapters widget --- spec/features/admin/manage_event_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/features/admin/manage_event_spec.rb b/spec/features/admin/manage_event_spec.rb index a66e21ecd..d0104cba5 100644 --- a/spec/features/admin/manage_event_spec.rb +++ b/spec/features/admin/manage_event_spec.rb @@ -25,7 +25,9 @@ find_by_id('event_chapter_ids_chosen').click find('.add-all-chapters', text: 'Add to all').click - expect(page).to have_css('.search-choice', count: Chapter.count) + within('#event_chapter_ids_chosen') do + expect(page).to have_css('.search-choice', count: Chapter.count) + end click_on 'Save' From 5d1cc28fe9df17a07b65f91950ece8c0d1a47e15 Mon Sep 17 00:00:00 2001 From: artfuldev Date: Sat, 12 Sep 2026 01:11:37 +0100 Subject: [PATCH 3/3] Pin today_and_upcoming spec's travel_to to avoid midnight flake --- spec/models/concerns/listable_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/concerns/listable_spec.rb b/spec/models/concerns/listable_spec.rb index ad0b19ed6..d54a86a08 100644 --- a/spec/models/concerns/listable_spec.rb +++ b/spec/models/concerns/listable_spec.rb @@ -6,7 +6,7 @@ context 'with scopes' do describe '#today_and_upcoming' do it 'returns a list of all today and upcoming workshops' do - travel_to(Time.current) do + travel_to(Time.current.middle_of_day) do Fabricate.times(2, :past_workshop) future_workshops = Fabricate.times(1, :workshop)