Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/staff/time_slots/create.turbo_stream.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

%turbo-stream{action: 'datatable-add', target: 'organizer-time-slots'}
%template
= render(time_slot_decorated)
= render(partial: 'staff/time_slots/time_slot', formats: [:html], object: time_slot_decorated)

= turbo_stream.update 'flash' do
= show_flash
Expand Down
2 changes: 1 addition & 1 deletion app/views/staff/time_slots/update.turbo_stream.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

%turbo-stream{action: 'datatable-update', target: 'organizer-time-slots', 'row-id': @time_slot.id}
%template
= render(time_slot_decorated)
= render(partial: 'staff/time_slots/time_slot', formats: [:html], object: time_slot_decorated)

= turbo_stream.update 'flash' do
= show_flash
25 changes: 25 additions & 0 deletions spec/system/staff/time_slots_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'rails_helper'

feature 'Staff Organizers can manage time slots', type: :system do
let(:event) { create(:event, start_date: Date.today, end_date: Date.today + 2.days) }
let!(:room) { create(:room, name: 'Main Hall', event: event) }
let!(:organizer_user) { create(:organizer, event: event) }

before { login_as(organizer_user) }

scenario 'creates a time slot via the "Save and Add" button', js: true do
visit event_staff_schedule_time_slots_path(event)

click_link 'Add Time Slot'

within('#time-slot-new-dialog') do
select '1', from: 'Day'
select 'Main Hall', from: 'Room'
click_button 'Save and Add'
end

expect(page).to have_content('Time slot added.')
expect(event.time_slots.count).to eq(1)
expect(page).to have_css('#organizer-time-slots tbody tr')
end
end
Loading