Working Remotely? Thinking about it?

Are you a member of a geographically dispersed team? Are you thinking of working remotely, or hiring remote developers? Wide Teams is my new blog and podcast for distributed teams. Check it out for getting started guides, tips and best practices, news, interviews, screencasts, and more all about working remotely and collaborating with wide-spread teams.

Rack-Test and Capybara are uneasy bedfellows

2010 June 18

I’m using Capybara on a new project because apparently it’s the new hotness. Today I found out that all is not peaceful in the Cucumber/Capybara/Rack-Test stack. There is a cold war going on, and both Capy and Rack-test are jealously guarding their own cookie jars.

Why does this matter? Well, say you use post '/some_callback', :some => "data" in your tests to simulate a callback from an external service like Janrain. Then you use visit '/' to simulate the user loading a page after the callback.

Any cookies set during the post will be ignored by the visit call, because like I said earlier, Capy and Rack-Test don’t share cookies. So if that callback action set up a user session, that session is now lost from the point of view of Capybara (and all the Cucumber steps that use Capybara).

Putting this out there in case anyone else runs into it and is as befuddled as I was.

Bookmark and Share
Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Related posts:

  1. TDD Accelerates Development
  2. Simple Design & Testing Conference 2007
blog comments powered by Disqus