-
Notifications
You must be signed in to change notification settings - Fork 17
action-cable-testing does not work with rspec-rails 4.0 and rails 5 #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like my suggestion does not help :( |
I finally solved the issue by doing the following in rails_spec.rb: module RSpec::Rails::FeatureCheck
module_function
def has_action_cable_testing?
true
end
end
require 'rspec/rails' and completely removing |
Seems that feature check in I think, that's correct: event though What was the problem with |
@palkan, it looks like The workaround I use seems right to me. It tells |
I had trouble getting the sample from @syakovyn to work in my case. If I didn't This is the solution that seems to be working for me: require "action_cable/testing"
require "rspec/rails/feature_check"
RSpec::Rails::FeatureCheck.module_eval do
module_function
def has_action_cable_testing?
true
end
end
require "rspec/rails" |
The issue happens due to the following check in action_cable/testing/rspec.rb:
if RSpec::Rails::FeatureCheck.respond_to?(:has_action_cable_testing?)
.It does not account for a fact that though the method is present it still returns false for Rails 5.
I suggest using
if RSpec::Rails::FeatureCheck.respond_to?(:has_action_cable_testing?) && RSpec::Rails::FeatureCheck.has_action_cable_testing?
instead.The text was updated successfully, but these errors were encountered: