module Minitest::Rails::Expectations::ActionCable::Channel

Public Instance Methods

must_have_stream_for(object) click to toggle source

Asserts that the specified stream for a model has started.

def test_assert_started_stream_for
  subscribe id: 42
  must_have_stream_for User.find(42)
end

See also ActionCable::Channel::TestCase#assert_has_stream_for See api.rubyonrails.org/v6.0/classes/ActionCable/Channel/TestCase/Behavior.html#method-i-assert_has_stream_for

# File lib/minitest/rails/expectations/action_cable.rb, line 139
extend ::ActiveSupport::Concern
must_have_streams(stream) click to toggle source

Asserts that the specified stream has been started.

def test_assert_started_stream
  subscribe
  must_have_streams 'messages'
end

See also ActionCable::Channel::TestCase#assert_has_stream See api.rubyonrails.org/v6.0/classes/ActionCable/Channel/TestCase/Behavior.html#method-i-assert_has_stream

# File lib/minitest/rails/expectations/action_cable.rb, line 125
          
wont_have_streams() click to toggle source

Asserts that no streams have been started.

def test_assert_no_started_stream
  subscribe
  wont_have_streams
end

See also ActionCable::Channel::TestCase#assert_no_streams See api.rubyonrails.org/v6.0/classes/ActionCable/Channel/TestCase/Behavior.html#method-i-assert_no_streams

# File lib/minitest/rails/expectations/action_cable.rb, line 111