Using Selenium with Webrat and Cucumber | BDDCasts - BDD Screencasts with Cucumber, RSpec and Ruby on Rails

In episode #136 of Railscasts , Ryan Bates showed us how to quickly turn a regular form into one that is submitted with Ajax. In this episode you can see how to write a feature to test this functionality using Selenium. Cucumber is great for Rails integration testing because it exercises the entire Rails stack, starting from the route mapper, through the controller, the models, right down to the database. To achieve this, it uses Webrat which accesses your application very close to how a browser would do it. Webrat however is not a browser. When you ask it to fetch a URL from your application, it actually takes a shortcut by instantiating your controllers and passing them a mock HTTP request. This method however, does not let you test the client-side AJAX functionality of your application. One solution, shown in this episode, is to use a full featured browser such as Firef...