Method: ActionCable::Channel::TestCase::Behavior#subscribe
- Defined in:
- actioncable/lib/action_cable/channel/test_case.rb
#subscribe(params = {}) ⇒ Object
Subscribe to the channel under test. Optionally pass subscription parameters as a Hash.
249 250 251 252 253 254 255 |
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 249 def subscribe(params = {}) @connection ||= stub_connection @subscription = self.class.channel_class.new(connection, CHANNEL_IDENTIFIER, params.with_indifferent_access) @subscription.singleton_class.include(ChannelStub) @subscription.subscribe_to_channel @subscription end |