-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Fix issue with connection.env
not being defined in test environments
#1684
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello,
When we rollbacked to 4.8.1 all the errors disappeared. |
st0012
added a commit
that referenced
this pull request
Jan 14, 2022
ActionCable's ConnectionStub (for testing) doesn't implement the exact same interfaces as Connection::Base. One thing that's missing is `env`. So calling `connection.env` direclty will fail in test environments when `stub_connection` is used. See #1684 for more information.
Thanks for the PR but I needed to do some additional changes. So I opened #1686 and will close this. |
st0012
added a commit
that referenced
this pull request
Jan 14, 2022
* Add specs for ActionCable's connection handling * Add workaround for ActionCable's ConnectionStub ActionCable's ConnectionStub (for testing) doesn't implement the exact same interfaces as Connection::Base. One thing that's missing is `env`. So calling `connection.env` direclty will fail in test environments when `stub_connection` is used. See #1684 for more information. * Update changelog
@st0012 Thanks so much! Any idea when this can get in? |
@cvoege it has gone out in v4.9.1 😄 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In test environments, the
env
method is not currently defined on the mockedActionCable::Channel::ConnectionStub
object. Leading to this error:This same exact issue was happening with AppSignal as well, which they highlighted in an issue here: appsignal/appsignal-ruby#684
I took the fix from their PR to fix it: https://github.com/appsignal/appsignal-ruby/pull/705/files
Would love to try to write tests for this if they are needed, but I'm really unversed in this repo and would probably need some guidance. Thought I'd just make the PR and ask for advice here!