Module: RSpec::Rails::ChannelExampleGroup
| Relationships & Source Files | |
| Namespace Children | |
|
Modules:
| |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
MinitestAssertionAdapter::ClassMethods,
SetupAndTeardownAdapter::ClassMethods,
ActiveSupport::Concern
|
|
|
Instance Chain:
self,
ActionCable::Channel::TestCase::Behavior,
ActionCable::Connection::TestCase::Behavior,
RailsExampleGroup,
ActiveSupport::ExecutionContext::TestHelper,
ActiveSupport::CurrentAttributes::TestHelper,
TaggedLoggingAdapter,
FixtureSupport::Fixtures,
FixtureSupport,
ActiveRecord::TestFixtures,
MinitestAssertionAdapter,
MinitestLifecycleAdapter,
SetupAndTeardownAdapter
|
|
| Defined in: | rspec-rails/lib/rspec/rails/example/channel_example_group.rb, rspec-rails/lib/rspec/rails/example/channel_example_group.rb |
Overview
Container module for channel spec functionality. It is only available if ActionCable has been loaded before it.
Class Method Summary
MinitestAssertionAdapter::ClassMethods - Extended
| assertion_method_names | Returns the names of assertion methods that we want to expose to examples without exposing non-assertion methods in Test::Unit or Minitest. |
| define_assertion_delegators | |
SetupAndTeardownAdapter::ClassMethods - Extended
Instance Attribute Summary
FixtureSupport - Included
| #run_in_transaction? | Monkey patched to avoid collisions with ‘let(:name)’ since |
Instance Method Summary
-
#have_rejected_connection
Checks that the connection attempt has been rejected.
-
#have_stream_for(object)
Checks that the channel has been subscribed to a stream for the given model.
-
#have_stream_from(stream)
Checks that the channel has been subscribed to the given stream.
-
#have_streams
Checks that the subscription is subscribed to at least one stream.
TaggedLoggingAdapter - Included
| #tagged_logger | Vendored from activesupport/lib/active_support/testing/tagged_logging.rb This implements the tagged_logger method where it is expected, but doesn’t call |
MinitestAssertionAdapter - Included
MinitestLifecycleAdapter - Included
SetupAndTeardownAdapter - Included
Instance Method Details
#have_rejected_connection
Checks that the connection attempt has been rejected.
# File 'rspec-rails/lib/rspec/rails/example/channel_example_group.rb', line 58
def have_rejected_connection raise_error(::ActionCable::Connection::Authorization::UnauthorizedError) end
#have_stream_for(object)
Checks that the channel has been subscribed to a stream for the given model
# File 'rspec-rails/lib/rspec/rails/example/channel_example_group.rb', line 86
def have_stream_for(object) check_subscribed! RSpec::Rails::Matchers::ActionCable::HaveStream.new(broadcasting_for(object)) end
#have_stream_from(stream)
Checks that the channel has been subscribed to the given stream
# File 'rspec-rails/lib/rspec/rails/example/channel_example_group.rb', line 76
def have_stream_from(stream) check_subscribed! RSpec::Rails::Matchers::ActionCable::HaveStream.new(stream) end
#have_streams
Checks that the subscription is subscribed to at least one stream.
# File 'rspec-rails/lib/rspec/rails/example/channel_example_group.rb', line 66
def have_streams check_subscribed! RSpec::Rails::Matchers::ActionCable::HaveStream.new end