Taskme update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user