What You’ve Done

In this chapter you explored a couple of techniques to help you when you’re trying to test a legacy Rails project. You saw how integration tests can be used to create test coverage without being concerned with the structure of the legacy code. You then saw how to use unit tests to build an understanding of how the code works. You also explored techniques to inject code into the system to change its behavior during test so as to focus the test on a particular piece of code.

Over the entire book, you’ve seen how to use automated developer testing to improve your Rails application, making it easier to validate behavior, and how to use tests to create good code that is easy to change. I’ve always found writing tests to be fun, and ...

Get Rails 5 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.