instance method connect

Ruby on Rails edge

Since edge

Signature

connect(path = ActionCable.server.config.mount_path, server: ActionCable.server, **request_params)

Performs connection attempt to exert #connect on the connection under test.

Accepts request path as the first argument and the following request options:

  • params – URL parameters (Hash)

  • headers – request headers (Hash)

  • session – session data (Hash)

  • env – additional Rack env configuration (Hash)

Parameters

path opt = ActionCable.server.config.mount_path
server key = ActionCable.server
request_params keyrest
Source
# File actioncable/lib/action_cable/connection/test_case.rb, line 294
        def connect(path = ActionCable.server.config.mount_path, server: ActionCable.server, **request_params)
          path ||= DEFAULT_PATH

          @socket = TestSocket.new(TestSocket.build_request(path, **request_params, cookies: cookies))
          @testserver = Connection::TestServer.new(server)
          connection = self.class.connection_class.new(@testserver, socket)
          connection.connect if connection.respond_to?(:connect)

          # Only set instance variable if connected successfully
          @connection = connection
        end

Defined in actioncable/lib/action_cable/connection/test_case.rb line 294 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionCable::Connection::TestServer::TestCase::Behavior

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close