aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/channel/stream_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2016-02-28 14:58:28 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2016-02-28 14:58:28 +0100
commitdabf47938f17f34d3146e72e1ba7c45defc92379 (patch)
treef76d347f5ba62627954a96eef5176cbf475662be /actioncable/test/channel/stream_test.rb
parent2280c84ffe278fd29217a7997db3739b38dbcc92 (diff)
parentbbe59375d074366b39d08ed078f0da02c7dddae1 (diff)
downloadrails-dabf47938f17f34d3146e72e1ba7c45defc92379.tar.gz
rails-dabf47938f17f34d3146e72e1ba7c45defc92379.tar.bz2
rails-dabf47938f17f34d3146e72e1ba7c45defc92379.zip
Merge pull request #23811 from iamvery/string-channel
Ensure actioncable behaves as expected with non-string queues
Diffstat (limited to 'actioncable/test/channel/stream_test.rb')
-rw-r--r--actioncable/test/channel/stream_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/actioncable/test/channel/stream_test.rb b/actioncable/test/channel/stream_test.rb
index 947efd96d4..526ea92e4f 100644
--- a/actioncable/test/channel/stream_test.rb
+++ b/actioncable/test/channel/stream_test.rb
@@ -14,7 +14,12 @@ class ActionCable::Channel::StreamTest < ActionCable::TestCase
def send_confirmation
transmit_subscription_confirmation
end
+ end
+ class SymbolChannel < ActionCable::Channel::Base
+ def subscribed
+ stream_from :channel
+ end
end
test "streaming start and stop" do
@@ -28,6 +33,17 @@ class ActionCable::Channel::StreamTest < ActionCable::TestCase
end
end
+ test "stream from non-string channel" do
+ run_in_eventmachine do
+ connection = TestConnection.new
+ connection.expects(:pubsub).returns mock().tap { |m| m.expects(:subscribe).with("channel", kind_of(Proc), kind_of(Proc)).returns stub_everything(:pubsub) }
+ channel = SymbolChannel.new connection, ""
+
+ connection.expects(:pubsub).returns mock().tap { |m| m.expects(:unsubscribe) }
+ channel.unsubscribe_from_channel
+ end
+ end
+
test "stream_for" do
run_in_eventmachine do
connection = TestConnection.new