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

Generated specs don't work with secure cookies #961

Open
philliplongman opened this issue Apr 23, 2022 · 2 comments
Open

Generated specs don't work with secure cookies #961

philliplongman opened this issue Apr 23, 2022 · 2 comments
Labels

Comments

@philliplongman
Copy link

philliplongman commented Apr 23, 2022

Six of the specs created by the generator will fail if you use the recommended setting of secure_cookie = true. If this is something that's expected in the test environment, I think that should be covered in the readme. If not, it probably needs to be fixed.

I made an example app to demonstrate the problem:
https://github.com/philliplongman/clearance_test

@sej3506
Copy link
Contributor

sej3506 commented May 2, 2022

I do see what you're talking about here.

One thing in particular I noticed was lib/clearance/configuration.rb states that secure_cookie should default to false, but it clearly defaults to nil. I'm marking this as a bug to look into further. Thank you for pointing this out.

@sej3506 sej3506 added the bugs label May 2, 2022
@michaelgt04
Copy link

I also ran into this issue recently. As soon as I set secure_cookie = true, my tests that rely on login don't work. I wasn't sure if it's possibly related to this. rspec/rspec-rails#1658

As a temporary fix, I'm doing this:

config.secure_cookie = Rails.env.test? ? false : true

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

No branches or pull requests

3 participants