Test Driving Rails
Test Driving Rails is a dead simple and straightforward book on the Rails default testing stack.
Check out the book's website for more information.
Foreword
Steven R. Baker, a testing legend behind minitest/mock and RSpec, wrote the foreword to the 1st edition.
Testimonials
"I started a new project with factories, but thanks to this book I made my tests 32% faster with fixtures."
~ Patrick Barattin, a Rails developer
Get comfortable with Rails testing
Testing is an important part of developing quality software. They are lots of opinions on how we should test Rails applications, but I think the answer is a bit nuanced. This book takes a pragmatic and unopinionated stance on testing web applications with Rails well-integrated testing stack.
Chapters
- Introduction
- Minitest
- Doubles
- Testing Rails
- Fixtures
- Model tests
- Integration tests
- System tests
- CI
- Reference
- Fin
Minitest & fixtures
Like with other things in the Rails Doctrine, Rails offers us Minitest and fixtures on its 'omasake' menu. And delicious menu it is! Minitest is easy to learn, read and understand without a complex DSL. Fixtures provides no fuss super fast testing data at your fingertips. What's not to like?
Why this book?
There are plenty of good testing books out there, but you'll have hard time finding an up-to-date book on testing Rails applications with the Rails default stack. Looks like the Rails community put Minitest and fixtures on the sideline in favour of RSpec and factories, but not anymore!
Who is this for?
I expect you to be already familiar with Rails as this is not a tutorial of building the whole application from scratch. I go straight down to talking about tests with varied examples. Previous knowledge of Minitest is not required.
What you'll get?
You'll get PDF and ePUB copies. The ePUB is tested on Apple Books and Kindle.
What about updates?
The book comes with lifetime updates.
Author
I am Josef, a long time Rails developer and an author of well received books Kamal Handbook and Deployment from Scratch. Despite doing lots of RSpec at work, I always used Minitest and fixtures in my own apps since the beggining to this very day. I want to show you that Rails default stack is enough -- and possibly better.
A Ruby on Rails testing guide focused on Minitest & fixtures