method

assert_broadcast_on

Importance_1
v7.1.3.4 - Show latest stable - 0 notes - Class: TestHelper
assert_broadcast_on(stream, data, &block) public

Asserts that the specified message has been sent to the stream.

def test_assert_transmitted_message
  ActionCable.server.broadcast 'messages', text: 'hello'
  assert_broadcast_on('messages', text: 'hello')
end

If a block is passed, that block should cause a message with the specified data to be sent.

def test_assert_broadcast_on_again
  assert_broadcast_on('messages', text: 'hello') do
    ActionCable.server.broadcast 'messages', text: 'hello'
  end
end
Show source
Register or log in to add new notes.