O'Reilly logo

Instant RSpec Test-Driven Development How-to by Charles Feduke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integration testing with Capybara (Advanced)

Capybara is a testing tool that helps test web applications by simulating the interaction a user would have with the application through their browser. It even has support for JavaScript behavior by driving an actual web browser.

In this recipe, Capybara is used to simulate a user interacting with the new view template of LocationController and then add client-side JavaScript validation.

By default, Capybara uses a very limited but fast headless web browser for validating Rack applications though it supports additional web browsers through different drivers. These examples use the Selenium driver for Capybara because it is the default. It requires that you have Mozilla Firefox installed.

Getting ready ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required