Taskme update

This commit is contained in:
Senad Uka
2020-06-30 05:08:23 +02:00
parent 1cd125382f
commit 71ad502cc1
210 changed files with 6316 additions and 766 deletions

View File

@@ -50,4 +50,21 @@ RSpec.describe BroadcastsChannel, type: :channel do
})
end
end
describe ".broadcast_file_upload_updates" do
it 'broadcasts to the channel with the right data' do
broadcast = create(:broadcast, :with_stream, :with_files, skip_create_callback: true)
files_content = ApplicationController.render partial: "broadcasts/file", collection: broadcast.files
expect {
BroadcastsChannel.broadcast_file_upload_updates(broadcast, broadcast.files, "pagination_content")
}.to have_broadcasted_to(broadcast).with({
event: 'file_upload_update',
broadcast_token: broadcast.token,
files_content: files_content,
pagination_content: "pagination_content"
})
end
end
end

View File

@@ -24,4 +24,20 @@ RSpec.describe ProjectsChannel, type: :channel do
}.to have_broadcasted_to(project).with(event: "video_status_update", content: content)
end
end
describe ".conference_recording_ready" do
it "broadcasts to the project channel" do
recording_file = Rack::Test::UploadedFile.new(Rails.root.join("spec", "fixtures", "files", "video_file.mp4"), "video/mp4")
zoom_meeting = create(:zoom_meeting, project: project, recording: recording_file)
video_url = 'http://url.to.video/video.mp4'
allow(zoom_meeting.recording).to receive(:service_url).and_return(video_url)
expect {
ProjectsChannel.conference_recording_ready(project, zoom_meeting.recording)
}.to have_broadcasted_to(project).with { |data|
expect(data['content']).to include(video_url)
expect(data['event']).to eq('conference_recording_ready')
}
end
end
end