-
Notifications
You must be signed in to change notification settings - Fork 637
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
Support string cookie values in rails test cases #734
Support string cookie values in rails test cases #734
Conversation
Hi @jcw- thanks for the contribution. On one hand, this seems good because it makes On the other hand, I don't think that |
Hi @jaredbeck, thanks for the quick response - good point about the After upgrading to 6.2, some of our specs started failing, they were specs that had this:
It didn't seem like |
Thanks for the clarification. I was able to reproduce the # spec/controllers/user_sessions_controller_spec.rb
describe '#new' do
it 'succeeds' do
+ request.cookies[:some_cookie] = "something"
UserSession.create!(....) # TypeError When I debug the issue, I arrive at the same solution you did. Please disregard my confusion about public/private API. Let's move forward with this, making sure that this feature (string cookies) is added consistently to all of our test classes. I think there's more than one place in |
@jaredbeck alright added support to the cookie jars, I'm not seeing anywhere else, let me know what you think... |
Released as 6.4.0 |
In Authlogic v6.2, a new method
cookie_enabled?
started exercising cookie code in test cases in a few more places than usual, resulting in existing test code in downstream projects that included cookies with string values (rather than hash values) to start failing with:This PR adds support for both, using the same approach as Rails itself.
Before:
![image](https://user-images.githubusercontent.com/6880880/102762915-30be3980-4336-11eb-9091-105621ddc3d9.png)
After:
![image](https://user-images.githubusercontent.com/6880880/102762931-387dde00-4336-11eb-8ee2-027292956beb.png)