instance method
connect
Ruby on Rails edge
Since edgeSignature
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
-
pathopt = ActionCable.server.config.mount_path -
serverkey = ActionCable.server -
request_paramskeyrest
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