Jump to ratings and reviews
Rate this book

Rails 5 Test Prescriptions: Build a Healthy Codebase

Rate this book
Does your Rails code suffer from bloat, brittleness, or inaccuracy? Cure these problems with the regular application of test-driven development. You'll use Rails 5.1, Minitest 5, and RSpec 3.6, as well as popular testing libraries such as factory_girl and Cucumber. Updates include Rails 5.1 system tests and Webpack integration. Do what the doctor ordered to make your applications feel all better. Side effects may include better code, fewer bugs, and happier developers.
Your Ruby on Rails application is sick. Deadlines are looming, but every time you make the slightest change to the code, something else breaks. Nobody remembers what that tricky piece of code was supposed to do, and nobody can tell what it actually does. Plus, it has bugs. You need test-driven a process for improving the design, maintainability, and long-term viability of software.
With both practical code examples and discussion of why testing works, this book starts with the most basic features delivered as part of core Ruby on Rails. Once you've integrated those features into your coding practice, work with popular third-party testing tools such as RSpec, Jasmine, Cucumber, and factory_girl. Test the component parts of a Rails application, including the back-end model logic and the front-end display logic. With Rails examples, use testing to enable your code to respond better to future change. Plus, see how to handle real-world testing situations.
This new edition has been updated to Rails 5.1 and RSpec 3.6 and contains full coverage of new Rails features, including system tests and the Webpack-based JavaScript setup.
What You
Ruby 2.4, Rails 5.1

679 pages, Kindle Edition

Published February 16, 2018

23 people are currently reading
55 people want to read

About the author

Noel Rappin

18 books4 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
13 (44%)
4 stars
12 (41%)
3 stars
3 (10%)
2 stars
1 (3%)
1 star
0 (0%)
Displaying 1 - 4 of 4 reviews
Profile Image for Jean Tessier.
164 reviews32 followers
December 5, 2019
I was looking to approach Ruby on Rails development from a TDD perspective, and seemed like a good way to do that. It builds up tests, one at a time, as it builds Rails artifacts. It's all well and nice, but Rails generators can bootstrap the process by generating specs alongside Rails artifacts. It's not quite test-driven, but it provides good coverage with minimal effort.

I was focusing on learning Rails, so I was jumping around in the book, looking up topics as I came across them. I think the book benefits from a more intentional reading that can make better use of its built-in narrative.

I will keep it close by as I work for when I need to dive deeper into a topic.
12 reviews1 follower
February 3, 2020
It covers the needed to get a good understanding of testing a Rails and even non-Rails applications. Although the book is focused mostly in using RSpec, it also has a chapter about minitest (which personally I wouldn't even think on adding to the book)

There's content about doubles, stubs, mocks, integration testing, the concept of TDD and also advices for approaching test in legacy applications.

The book is clearly worth reading. I haven't read the past editions, but this one shines on its own.
Profile Image for Mridul Singhai.
50 reviews12 followers
February 3, 2019
Originally started reading this as a part of a book-club at work. The book club did not quite work out for a variety of reasons, but sure, this did improve how I write tests. Would be greatly helpful for someone just starting to find their way across a Rails codebase.
Profile Image for Michael Webb.
156 reviews5 followers
December 16, 2017
Does what it says on the tin. If you're looking for broader best practices that aren't stack-specific, look elsewhere.
Displaying 1 - 4 of 4 reviews

Can't find what you're looking for?

Get help and learn more about the design.