Marry Capybara with SSL-enabled applications

Posted Over 13 years ago. Visible to the public.

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
Last edit
Almost 13 years ago
Attachments
Keywords
cucumber, https
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2010-08-31 16:47)