Outside-in Testing
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 ...
Get Rails 4 Test Prescriptions now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.