Method: ActionCable::Channel::TestCase::Behavior#stub_connection

Defined in:
actioncable/lib/action_cable/channel/test_case.rb

#stub_connection(identifiers = {}) ⇒ Object

Set up test connection with the specified identifiers:

class ApplicationCable < ActionCable::Connection::Base
  identified_by :user, :token
end

stub_connection(user: users[:john], token: 'my-secret-token')


243
244
245
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 243

def stub_connection(identifiers = {})
  @connection = ConnectionStub.new(identifiers)
end