Read more

Marry Capybara with SSL-enabled applications

Henning Koch
August 31, 2010Software engineer at makandra GmbH

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.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

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).

Posted by Henning Koch to makandra dev (2010-08-31 18:47)