The book
Ten chapters in PDF, EPUB, and HTML, with paired Minitest and RSpec examples.
Rails Implementation Guide
Know what to test in a Rails app and where to test it.
Follow one Rails app through Minitest and RSpec examples. See when a model test is enough, what to check in a request test, and when a browser is worth the extra setup.
Read a free chapterIn final editing · 10 chapters · Rails 8.1 · Agent Companion
Not on sale yet. It joins the Developer Library when it’s finished.

Suppose a regular member tries to change an admin’s role. A test that only checks for a 403 can pass even if the app changes the role before denying the request. Chapter 4 shows how to test the whole denial.
403.Name the behavior someone relies on before deciding what to test.
Choose between model, request, job, and browser tests based on what can break.
Use assertions that catch regressions and survive harmless refactors.
Prove a denial leaves protected data and side effects alone.
Check invariants and prove that an operation really rolls back.
Stub transport failures and check the request your client actually sends.
Test enqueueing, execution, and recovery at their own boundaries.
Use real sessions to test Turbo frames and tenant-scoped streams.
Build fixtures or factories that make the important relationships visible.
Audit an existing suite for proof, maintenance cost, and missing coverage.
Ten chapters in PDF, EPUB, and HTML, with paired Minitest and RSpec examples.
Two Rails apps exercise the same behavior and back the guide’s weak-versus-strong test comparisons.
Contracts, recipes, and review checklists for testing a change or auditing an existing suite.
Read the complete chapter on authentication, authorization, and tenancy, including the paired examples.