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