Search⌘ K
AI Features

Outside-in Testing

Explore outside-in testing to manage feature development in Rails applications. Learn to write end-to-end acceptance tests with Capybara, use test failures to guide unit test creation, and ensure robust integration and unit coverage. This lesson helps you build user-facing features systematically by driving development with failing tests and refining your code through iteration.

Outside-in testing process

The process we’ll use to manage the feature tests is sometimes called outside-in testing. We use Capybara to write a test from the outside and use that test to drive the unit tests. In the same way TDD uses a failing unit test to drive code, outside-in testing uses a failing acceptance test (or a failing line in an acceptance test) to drive the creation of unit tests.

The process is illustrated in the following figure: we’re assuming creating a new user-facing feature in a Rails application.

Outside-in testing process steps

Let’s ...