Module: RSpec::Rails::ChannelExampleGroup

Extended by:
ActiveSupport::Concern
Includes:
ActionCable::Channel::TestCase::Behavior, ActionCable::Connection::TestCase::Behavior, RailsExampleGroup
Defined in:
lib/rspec/rails/example/channel_example_group.rb,
lib/rspec/rails/example/channel_example_group.rb

Overview

Container module for channel spec functionality.

Defined Under Namespace

Modules: ClassMethods

Constant Summary

Constants included from ActionCable::Channel::TestCase::Behavior

ActionCable::Channel::TestCase::Behavior::CHANNEL_IDENTIFIER

Constants included from ActionCable::TestHelper

ActionCable::TestHelper::CHANNEL_NOT_FOUND

Constants included from ActionCable::Connection::TestCase::Behavior

ActionCable::Connection::TestCase::Behavior::DEFAULT_PATH

Instance Method Summary collapse

Methods included from ActionCable::Channel::TestCase::Behavior

#assert_broadcast_on, #assert_broadcasts, #assert_has_stream, #assert_has_stream_for, #assert_no_streams, #perform, #stub_connection, #subscribe, #transmissions, #unsubscribe

Methods included from ActionCable::TestHelper

#after_teardown, #assert_broadcast_on, #assert_broadcasts, #assert_no_broadcasts, #before_setup, #pubsub_adapter

Methods included from ActionCable::Connection::TestCase::Behavior

#connect, #cookies, #disconnect

Methods included from ActionCable::Connection::Assertions

#assert_reject_connection

Instance Method Details

#have_rejected_connectionObject



42
43
44
# File 'lib/rspec/rails/example/channel_example_group.rb', line 42

def have_rejected_connection
  raise_error(::ActionCable::Connection::Authorization::UnauthorizedError)
end

#have_stream_for(object) ⇒ Object



58
59
60
61
62
# File 'lib/rspec/rails/example/channel_example_group.rb', line 58

def have_stream_for(object)
  check_subscribed!

  RSpec::Rails::Matchers::ActionCable::HaveStream.new(broadcasting_for(object))
end

#have_stream_from(stream) ⇒ Object



52
53
54
55
56
# File 'lib/rspec/rails/example/channel_example_group.rb', line 52

def have_stream_from(stream)
  check_subscribed!

  RSpec::Rails::Matchers::ActionCable::HaveStream.new(stream)
end

#have_streamsObject



46
47
48
49
50
# File 'lib/rspec/rails/example/channel_example_group.rb', line 46

def have_streams
  check_subscribed!

  RSpec::Rails::Matchers::ActionCable::HaveStream.new
end