instance method connect

Ruby on Rails 8.1.2

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

connect(path = ActionCable.server.config.mount_path, **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
request_params keyrest
Source
# File actioncable/lib/action_cable/connection/test_case.rb, line 192
        def connect(path = ActionCable.server.config.mount_path, **request_params)
          path ||= DEFAULT_PATH

          connection = self.class.connection_class.allocate
          connection.singleton_class.include(TestConnection)
          connection.send(:initialize, build_test_request(path, **request_params))
          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 192 · View on GitHub · Improve this page · Find usages on GitHub

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

Type at least 2 characters to search.

↑↓ navigate · open · esc close