Marry Capybara with SSL-enabled applications

Capybara does not play nice Show archive.org snapshot 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 hack-free workaround right now is to use URLs in lieu of paths everywhere (links, form actions).

For a hackful fix, copy the attached file to features/support/ssl_fix.rb.

This issue is fixed Show archive.org snapshot in the Capybara master and should no longer be present in future releases of the gem (I'm writing this on 2011-05-22).

Henning Koch Over 13 years ago