Force HTTPS/SSL for all controller/request specs i

2019-08-01 03:38发布

问题:

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.