Module: ActionCable::Channel::ChannelStub

Defined in:
lib/action_cable/channel/test_case.rb

Overview

Action Cable Channel Stub

Stub stream_from to track streams for the channel. Add public aliases for subscription_confirmation_sent? and subscription_rejected?.

Instance Method Summary collapse

Instance Method Details

#confirmed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/action_cable/channel/test_case.rb', line 24

def confirmed?
  subscription_confirmation_sent?
end

#rejected?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/action_cable/channel/test_case.rb', line 28

def rejected?
  subscription_rejected?
end

#start_periodic_timersObject Also known as: stop_periodic_timers

Make periodic timers no-op



45
# File 'lib/action_cable/channel/test_case.rb', line 45

def start_periodic_timers; end

#stop_all_streamsObject



36
37
38
# File 'lib/action_cable/channel/test_case.rb', line 36

def stop_all_streams
  @_streams = []
end

#stream_from(broadcasting) ⇒ Object



32
33
34
# File 'lib/action_cable/channel/test_case.rb', line 32

def stream_from(broadcasting, *)
  streams << broadcasting
end

#streamsObject



40
41
42
# File 'lib/action_cable/channel/test_case.rb', line 40

def streams
  @_streams ||= []
end