method
assert_no_broadcasts
v7.1.3.2 -
Show latest stable
- Class:
ActionCable::TestHelper
assert_no_broadcasts(stream, &block)public
Asserts that no messages have been sent to the stream.
def test_no_broadcasts assert_no_broadcasts 'messages' ActionCable.server.broadcast 'messages', { text: 'hi' } assert_broadcasts 'messages', 1 end
If a block is passed, that block should not cause any message to be sent.
def test_broadcasts_again assert_no_broadcasts 'messages' do # No job messages should be sent from this block end end
Note: This assertion is simply a shortcut for:
assert_broadcasts 'messages', 0, &block