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:
parent
911f44f720
commit
62a8e838e0
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue