1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Matthew Draper 2017-03-23 05:52:38 +10:30
parent 911f44f720
commit 62a8e838e0

View file

@ -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