问题
I'm using RSpec 3.5.0, and would like to enable HTTPS/SSL requests for all my specs.
Since I added force_ssl
to my ApplicationController
, all my specs are failing, since they are redirecting to the secure version of the site instead of rendering, etc.
回答1:
The suggestions here don't work under rails 5. If that's part of where you're stuck adding https!
to your spec should work.
来源:https://stackoverflow.com/questions/40633069/force-https-ssl-for-all-controller-request-specs-in-rspec