-
Notifications
You must be signed in to change notification settings - Fork 116
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
undefined method `env' for #<ActionCable::Channel::ConnectionStub> #684
Labels
Comments
iduuck
changed the title
undefinde method `env' for #<ActionCable::Channel::ConnectionStub>
undefined method `env' for #<ActionCable::Channel::ConnectionStub>
Jan 13, 2021
I've reproduced the problem and am working on a fix. |
tombruijn
added a commit
to appsignal/test-setups
that referenced
this issue
Feb 12, 2021
Allow testing of appsignal/appsignal-ruby#684 in a test setups environment.
tombruijn
added a commit
that referenced
this issue
Feb 15, 2021
When an Rails 6+ app test suite calls `stub_connection` for ActionCable tests in an app AppSignal integrates with, it would fail with the following error as reported in #684: ``` undefined method `env' for #<ActionCable::Channel::ConnectionStub> ``` To fix this, check if the `env` method is available before calling it to prevent the error from occurring. Ideally we fix this upstream and make the `ConnectionStub` behave more like an actual connection but with this fix it at least works from our end now. This change breaks on Rails 5 as there is no `action_cable/channel/test_case` file/helper, it appears to use the real connection class in that version.
tombruijn
added a commit
that referenced
this issue
Feb 18, 2021
When an Rails 6+ app test suite calls `stub_connection` for ActionCable tests in an app AppSignal integrates with, it would fail with the following error as reported in #684: ``` undefined method `env' for #<ActionCable::Channel::ConnectionStub> ``` To fix this, check if the `env` method is available before calling it to prevent the error from occurring. Ideally we fix this upstream and make the `ConnectionStub` behave more like an actual connection but with this fix it at least works from our end now. This change breaks on Rails 5 as there is no `action_cable/channel/test_case` file/helper, it appears to use the real connection class in that version.
@iduuck Thanks again for the report! A fix for this has been released in Ruby gem 2.11.7. Please upgrade and let us know if you run into any problems :) |
This was referenced Jan 13, 2022
shairyar
pushed a commit
to appsignal/test-setups
that referenced
this issue
Aug 26, 2022
Allow testing of appsignal/appsignal-ruby#684 in a test setups environment.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I am currently trying to make my RSpec test working, and I recently stumbled upon a failure, which I think is a bug in the system.
When I use the
stub_connection
helper. I am getting the following error.To Reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: