From 62a8e838e0e06893f1c63d40026012b44b4d1d37 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Thu, 23 Mar 2017 05:52:38 +1030 Subject: 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. --- actioncable/test/channel/stream_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actioncable') 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 -- cgit v1.2.3