Skip to content
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

Improve ActionCable's TestCookieJar interface #51930

Merged
merged 1 commit into from
May 28, 2024

Conversation

justinko
Copy link
Contributor

@justinko justinko commented May 28, 2024

Fixes #51914

Motivation / Background

This change brings ActionCable::Connection::TestCookieJar in alignment with ActionDispatch::Cookies::CookieJar in regards to setting the cookie value.

Before:

cookies[:foo] = { value: "bar" }
puts cookies[:foo] # => { value: "bar" }

After:

cookies[:foo] = { value: "bar" }
puts cookies[:foo] # => "bar"

Additional information

Technically this is a breaking change but I don't know why the user would depend on an incorrect interface.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rafaelfranca rafaelfranca merged commit 93f4b6d into rails:main May 28, 2024
3 checks passed
rafaelfranca added a commit that referenced this pull request May 28, 2024
Improve ActionCable's TestCookieJar interface
@lzell
Copy link

lzell commented May 29, 2024

Thank you @justinko and @rafaelfranca for tackling that so quickly!

@zzak
Copy link
Member

zzak commented May 31, 2024

@justinko Would you mind adding a changelog? The Action Cable changelog is usually pretty short, so no need to be conservative IMO.

@justinko
Copy link
Contributor Author

@justinko Would you mind adding a changelog? The Action Cable changelog is usually pretty short, so no need to be conservative IMO.

#51979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActionCable tests fail when encrypted cookie is set with options
4 participants