Webrat: Rails Acceptance Testing Evolved

Location: Pavilion 2 - 3 Level:
Average rating: ****.
(4.44, 64 ratings)

A robust suite of acceptance tests ensures your Rails app stays working giving you extreme freedom to refactor. Unfortunately, traditional full-stack acceptance testing of web-based applications has centered on in-browser solutions like Selenium and Watir that immediately present challenges like speed, timing/waiting and sharing data across processes, all through a relatively clunky API designed without Ruby in mind. Getting started was troublesome, and keeping things running smoothly was a constant concern.

Webrat, a Ruby DSL for interaction with web applications, changes the acceptance testing ROI equation. By implementing an invisible, fast browser simulator you can use from within your test framework of choice (Test::Unit, RSpec, Shoulda or Cucumber), it sidesteps most of Selenium’s drawbacks while retaining the coverage value.

Recently, seamless Webrat integration featured prominently in the Merb 1.0 release as the recommended approach for high level testing, a theme that will be a part of the Rails 3 push. Webrat is fast becoming the ubiquitous API for driving web applications from Ruby with it’s support for different adapters like Selenium, Mechanize and Celerity.

This talk, delivered by the maintainer of Webrat, will describe the value of acceptance testing for Rails apps, common pitfalls, and Webrat’s solutions. We’ll look at techniques for writing maintainable acceptance tests, and maximizing their value over the lifespan of an application. Finally, we’ll explore advanced techniques like applying Webrat to ease some of the pain of in-browser testing when it can’t be avoided (JavaScript/AJAX, primarily).

Photo of Bryan Helmkamp

Bryan Helmkamp


Bryan Helmkamp is the lead maintainer of Webrat, a library to implement acceptance testing of a Ruby web application in a more expressive and maintainable way. He’s a co-author of The RSpec Book, which is now available as a beta PDF. Following three years of Ruby on Rails consulting, Bryan is now a software engineer at Weplay, a New York City-based startup building online tools for the youth sports community. Bryan’s software development blog is located at http://brynary.com/.

Comments on this page are now closed.


Picture of Jeff Wigal
Jeff Wigal
05/08/2009 1:37am PDT

This was a terrific presentation. Easy to follow, great information, some nice concrete examples of how to use Webrat

News and Coverage
co-presented by Ruby Central, Inc. O'Reilly
  • Engine Yard
  • Heroku
  • Sun Microsystems
  • Blue Box Group
  • New Relic

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at RailsConf, contact Yvonne Romaine at yromaine@oreilly.com.

Download the RailsConf Sponsor/Exhibitor Prospectus

Media Partner Opportunities

Download the Media & Promotional Partner Brochure (PDF) for information on trade opportunities with O'Reilly conferences or contact mediapartners@ oreilly.com

Program Ideas

Post your suggestions for speakers, topics, and activities on the RailsConf wiki or send an email to rails-idea@oreilly.com.

Press and Media

For media-related inquiries, contact Maureen Jennings at maureen@oreilly.com.

Contact Us

View a complete list of RailsConf 2009 contacts.