Module: ActionCable::Channel::ChannelStub

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

Overview

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)
[View source]

22
23
24
# File 'lib/action_cable/channel/test_case.rb', line 22

def confirmed?
  subscription_confirmation_sent?
end

#rejected?Boolean

Returns:

  • (Boolean)
[View source]

26
27
28
# File 'lib/action_cable/channel/test_case.rb', line 26

def rejected?
  subscription_rejected?
end

#start_periodic_timersObject Also known as: stop_periodic_timers

Make periodic timers no-op

[View source]

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

def start_periodic_timers; end

#stop_all_streamsObject

[View source]

34
35
36
# File 'lib/action_cable/channel/test_case.rb', line 34

def stop_all_streams
  @_streams = []
end

#stream_from(broadcasting) ⇒ Object

[View source]

30
31
32
# File 'lib/action_cable/channel/test_case.rb', line 30

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

#streamsObject

[View source]

38
39
40
# File 'lib/action_cable/channel/test_case.rb', line 38

def streams
  @_streams ||= []
end