The process we’ll use to manage our Capybara tests is sometimes called outside-in testing—we start using Capybara to write a test from the outside and use that test to drive our unit tests. In the same way that 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 follows Figure 1, Outside-in testing—we’re assuming the creation of a new user-facing feature in a Rails application.
Let’s walk through the steps.
Write the end-to-end test that shows a user interacting ...