-
Notifications
You must be signed in to change notification settings - Fork 244
fix/cookie jar delete #356
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
Conversation
|
@rafaelfranca I made the necessary changes. |
|
I disagree that we should accept symbols for these methods. We shouldn't accept/convert them in |
|
What does deprecating/disallowing this give to the users of rack-tests? Or do you think deprecate/disallow would make this library easier to implement/maintain and that is what you are prioritizing in this situation? Not particularly trying to push into any direction here, just want to understand the thought process so we can apply consistently in future PRs. |
rack-test expects string keys for cookies, not symbols. See rack/rack-test#356.
|
I removed the urgency from this decision by changing Rails to use the implementation we currently have in this gem in rails/rails@b164bb8. Now we can decide what is best for this project. As context, this was when we started to accept symbols in |
|
As a general principle, I don't think you should automatically convert symbols to strings or vice-versa. Doing so leads to community confusion about the differences between symbols and strings. In many cases, this included, backwards compatibility means you may need continue to support previous design mistakes. However, that doesn't mean you need to allow for proliferation of such mistakes. I'm not advocating for deprecating Note that this particular issue is not only a convert symbol to string issue, as this accepts any object supporting |
|
I agree with your general principle. I also don't think this project specifically need to handle the design decision of Rails. Rails wraps most of the I'm fine with rejecting this change as well. And I'd not deprecate the behavior of Thank you for the pull request @jmschp and thank you for bringing the Rails issue to my attention. |
|
Thanks @rafaelfranca and @jeremyevans. Totally understand the String/Symbol concern, and actually agree with it. |
What
I believe that the
Rack::Test::CookieJar#deleteand theRack::Test::CookieJar#get_cookieshould accept the cookie name as a Symbol. Just likeRack::Test::CookieJar#[]convert the argument to a stingdeleteandget_cookieshould do the same.For example the
SessionTestHelperfrom Rails to be introduced in the next version usescookies.delete(:session_id), with the current implementation this is not going to work.