aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-03-23 05:52:38 +1030
committerMatthew Draper <matthew@trebex.net>2017-03-23 05:52:38 +1030
commit62a8e838e0e06893f1c63d40026012b44b4d1d37 (patch)
treea3a9477bb2a36ea301123d56445db6dc91fca9d5 /actioncable/test
parent911f44f72048708b83e75da067b2d292c8692106 (diff)
downloadrails-62a8e838e0e06893f1c63d40026012b44b4d1d37.tar.gz
rails-62a8e838e0e06893f1c63d40026012b44b4d1d37.tar.bz2
rails-62a8e838e0e06893f1c63d40026012b44b4d1d37.zip
Fix a race in ActionCable stream tests
These tests double-stub connection.pubsub, so we need to ensure the first call's completed before we set up for the second.
Diffstat (limited to 'actioncable/test')
-rw-r--r--actioncable/test/channel/stream_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actioncable/test/channel/stream_test.rb b/actioncable/test/channel/stream_test.rb
index 31dcde2e29..50fc7be30b 100644
--- a/actioncable/test/channel/stream_test.rb
+++ b/actioncable/test/channel/stream_test.rb
@@ -55,6 +55,8 @@ module ActionCable::StreamTests
channel = ChatChannel.new connection, "{id: 1}", id: 1
channel.subscribe_to_channel
+ wait_for_async
+
connection.expects(:pubsub).returns mock().tap { |m| m.expects(:unsubscribe) }
channel.unsubscribe_from_channel
end
@@ -67,6 +69,8 @@ module ActionCable::StreamTests
channel = SymbolChannel.new connection, ""
channel.subscribe_to_channel
+ wait_for_async
+
connection.expects(:pubsub).returns mock().tap { |m| m.expects(:unsubscribe) }
channel.unsubscribe_from_channel
end