Skip to content

Commit 1eb171b

Browse files
authored
Merge pull request #2131 from rspec/jon_sunday_code_review
Addressing Jon code-review on 4-0-dev
2 parents 7ff7c3e + a6d7369 commit 1eb171b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

features/channel_specs/channel_spec.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Feature: channel spec
44
Channel specs are marked by `:type => :channel` or if you have set
55
`config.infer_spec_type_from_file_location!` by placing them in `spec/channels`.
66

7-
A channel spec is a thin wrapper for an ActionCable::Channel::TestCase, and includes all
7+
A channel spec is a thin wrapper for an `ActionCable::Channel::TestCase`, and includes all
88
of the behavior and assertions that it provides, in addition to RSpec's own
99
behavior and expectations.
1010

11-
It also includes helpers from ActionCable::Connection::TestCase to make it possible to
11+
It also includes helpers from `ActionCable::Connection::TestCase` to make it possible to
1212
test connection behavior.
1313

1414
Background:

lib/rspec/rails/configuration.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,19 @@ def filter_rails_from_backtrace!
135135
end
136136
end
137137

138-
if defined?(ActionMailer)
138+
if RSpec::Rails::FeatureCheck.has_action_mailer?
139139
config.include RSpec::Rails::MailerExampleGroup, :type => :mailer
140140
end
141141

142-
if defined?(ActiveJob)
142+
if RSpec::Rails::FeatureCheck.has_active_job?
143143
config.include RSpec::Rails::JobExampleGroup, :type => :job
144144
end
145145

146-
if defined?(ActionCable) && ::Rails::VERSION::STRING > '6'
146+
if RSpec::Rails::FeatureCheck.has_action_cable_testing?
147147
config.include RSpec::Rails::ChannelExampleGroup, :type => :channel
148148
end
149149

150-
if defined?(ActionMailbox)
150+
if RSpec::Rails::FeatureCheck.has_action_mailbox?
151151
config.include RSpec::Rails::MailboxExampleGroup, :type => :mailbox
152152
end
153153
end

lib/rspec/rails/example/channel_example_group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module ClassMethods
1515
end
1616
end
1717

18-
if ::Rails::VERSION::MAJOR >= 6
18+
if RSpec::Rails::FeatureCheck.has_action_cable_testing?
1919
module RSpec
2020
module Rails
2121
# @api public

0 commit comments

Comments
 (0)