aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/channel/test_case.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2019-01-24 23:40:33 +0100
committerGitHub <noreply@github.com>2019-01-24 23:40:33 +0100
commit36c840057fb46c09457a8b091d2db6351d2efeef (patch)
tree81550fc640989953b8311d1c94584b36f716c752 /actioncable/lib/action_cable/channel/test_case.rb
parent87626a60426e7b8aa8e4048d7d4b7463ba62bd96 (diff)
parentcfe65cb478a44f19f3b4562cd1cf3c99d2cb930b (diff)
downloadrails-36c840057fb46c09457a8b091d2db6351d2efeef.tar.gz
rails-36c840057fb46c09457a8b091d2db6351d2efeef.tar.bz2
rails-36c840057fb46c09457a8b091d2db6351d2efeef.zip
Merge pull request #35021 from palkan/refactor/broadcasting-for-testing
Action Cable: move channel_name to Channel.broadcasting_for
Diffstat (limited to 'actioncable/lib/action_cable/channel/test_case.rb')
-rw-r--r--actioncable/lib/action_cable/channel/test_case.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/actioncable/lib/action_cable/channel/test_case.rb b/actioncable/lib/action_cable/channel/test_case.rb
index c4cf0ac0e7..b05d51a61a 100644
--- a/actioncable/lib/action_cable/channel/test_case.rb
+++ b/actioncable/lib/action_cable/channel/test_case.rb
@@ -143,7 +143,7 @@ module ActionCable
# You need to set up your connection manually to provide values for the identifiers.
# To do this just use:
#
- # stub_connection(user: users[:john])
+ # stub_connection(user: users(:john))
#
# == Testing broadcasting
#
@@ -157,9 +157,9 @@ module ActionCable
# end
#
# def test_speak
- # subscribe room_id: rooms[:chat].id
+ # subscribe room_id: rooms(:chat).id
#
- # assert_broadcasts_on(rooms[:chat], text: "Hello, Rails!") do
+ # assert_broadcasts_on(rooms(:chat), text: "Hello, Rails!") do
# perform :speak, message: "Hello, Rails!"
# end
# end
@@ -300,9 +300,7 @@ module ActionCable
def broadcasting_for(stream_or_object)
return stream_or_object if stream_or_object.is_a?(String)
- self.class.channel_class.broadcasting_for(
- [self.class.channel_class.channel_name, stream_or_object]
- )
+ self.class.channel_class.broadcasting_for(stream_or_object)
end
end