Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
The test case can be run with script/cucumber features/ssl.feature A before_filter in ApplicationController prints out details about every request, so you can observe Capybara (or Rack::Test) losing the HTTPS protocol once it followed the redirect from ssl_requirement. The issue (http://github.com/jnicklas/capybara/issues#issue/85) is this: Capybara does not play nice with sites that have some actions protected by SSL, some not. A popular way to implement this in Rails is using the ssl_requirement plugin by DHH, which redirects a requests from HTTP to HTTPS if the requested action requires SSL and vice versa. Capybara follows the redirect, but seems to forget the changed protocol for the next request. The only workaround right now is to use URLs in lieu of paths everywhere (links, form actions).