add spec
This commit is contained in:
@@ -78,6 +78,42 @@ feature 'User managing broadcasts' do
|
||||
expect(page).to have_content token_reset_notice
|
||||
end
|
||||
|
||||
scenario 'Player will not reload if stream is reactivated while user is watching previous recording', js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
recording = create(:broadcast_recording, broadcast: broadcast)
|
||||
|
||||
visit project_broadcast_path(project, broadcast)
|
||||
|
||||
expect(page).to have_content stream_idle_message
|
||||
|
||||
broadcast.streamer_status = :recording
|
||||
broadcast.status = :active
|
||||
BroadcastsChannel.broadcast_stream_updates(broadcast)
|
||||
|
||||
expect(page).to have_content stream_begun_message
|
||||
|
||||
broadcast.streamer_status = :idle
|
||||
broadcast.status = :idle
|
||||
BroadcastsChannel.broadcast_stream_updates(broadcast)
|
||||
|
||||
expect(page).to have_content stream_idle_message
|
||||
|
||||
click_on switch_view_dropdown
|
||||
click_on recording.download_file_name
|
||||
|
||||
player = find('#broadcast_video', visible: :all)
|
||||
player_html_for_recording = player.native.attribute('outerHTML').clone
|
||||
|
||||
broadcast.streamer_status = :recording
|
||||
broadcast.status = :active
|
||||
BroadcastsChannel.broadcast_stream_updates(broadcast)
|
||||
|
||||
expect(page).to have_content stream_begun_message
|
||||
|
||||
player_html_after_stream_starts = player.native.attribute('outerHTML')
|
||||
expect(player_html_after_stream_starts).to eq player_html_for_recording
|
||||
end
|
||||
|
||||
scenario 'user can go back and forth between live session and previous sessions', js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
recording = create(:broadcast_recording, broadcast: broadcast)
|
||||
@@ -212,4 +248,14 @@ feature 'User managing broadcasts' do
|
||||
def token_reset_notice
|
||||
t 'broadcasts.update.reset_notice'
|
||||
end
|
||||
|
||||
def stream_begun_message
|
||||
'Live stream has begun, click play to watch it'
|
||||
end
|
||||
|
||||
def stream_idle_message
|
||||
'Live stream is waiting to begin'
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user