Force HTTPS/SSL for all controller/request specs in rspec

送分小仙女□ 提交于 2020-01-05 07:27:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!