Hey folks,
With more and more of our Rails apps being tested with a Capybara driver that can execute Javascript (such as Capybara Webkit), while also using more JavaScript libraries like Stripe.js or Facebook's JavaScript client, we've noticed more acceptance test suites making HTTP requests from the Javascript code.
That's a problem the Ruby community has solved pretty well with tools like WebMock, VCR, and others stubbing out Net::HTTP.
It took me awhile to wrap my head around the components involved in doing something similar for Capybara Webkit suites until Joe wrote up this post:
http://robots.thoughtbot.com/post/34761570235/using-capybara-to-test-javascript-that-makes-http
Would love to get your feedback on the technique.
Cheers,
Dan