instance method stub_connection

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

stub_connection(identifiers = {})

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')

Parameters

identifiers opt = {}
Source
# File actioncable/lib/action_cable/channel/test_case.rb, line 243
        def stub_connection(identifiers = {})
          @connection = ConnectionStub.new(identifiers)
        end

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

Defined in ActionCable::Channel::TestCase::Behavior

Type at least 2 characters to search.

↑↓ navigate · open · esc close