aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/channel/broadcasting_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test/channel/broadcasting_test.rb')
-rw-r--r--actioncable/test/channel/broadcasting_test.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/actioncable/test/channel/broadcasting_test.rb b/actioncable/test/channel/broadcasting_test.rb
index ab58f33511..2cbfabc1d0 100644
--- a/actioncable/test/channel/broadcasting_test.rb
+++ b/actioncable/test/channel/broadcasting_test.rb
@@ -4,7 +4,7 @@ require "test_helper"
require "stubs/test_connection"
require "stubs/room"
-class ActionCable::Channel::BroadcastingTest < ActiveSupport::TestCase
+class ActionCable::Channel::BroadcastingTest < ActionCable::TestCase
class ChatChannel < ActionCable::Channel::Base
end
@@ -13,8 +13,16 @@ class ActionCable::Channel::BroadcastingTest < ActiveSupport::TestCase
end
test "broadcasts_to" do
- ActionCable.stubs(:server).returns mock().tap { |m| m.expects(:broadcast).with("action_cable:channel:broadcasting_test:chat:Room#1-Campfire", "Hello World") }
- ChatChannel.broadcast_to(Room.new(1), "Hello World")
+ assert_called_with(
+ ActionCable.server,
+ :broadcast,
+ [
+ "action_cable:channel:broadcasting_test:chat:Room#1-Campfire",
+ "Hello World"
+ ]
+ ) do
+ ChatChannel.broadcast_to(Room.new(1), "Hello World")
+ end
end
test "broadcasting_for with an object" do