Test Rails apps with Minitest, not guesswork
Learn automated testing step by step, from CRUD to models, fixtures, system tests, mailers, jobs, and CI. Minitest, fixtures, and Rails defaults the whole way.
In an age where AI dominates the headlines, there has never been a more important time for real human in the loop testing. And when it comes to automated testing in Rails, Prabin Poudel is who I trust to get it right.
Start here in three steps
You don't have to read everything today. Follow this path and you'll have a real test running in your own app.
-
Step 1
See why Minitest fits Rails
Read the introduction: who this is for, how the Cookbook app grows, and why you won't need to hunt for a second test stack.
-
Step 2
Set up the Cookbook app
Spin up the sample app with Minitest and system tests wired the way later chapters expect.
-
Step 3
Write your first automated test
Turn a scenario into a failing test, make it pass, and build the habit of green before you commit.
Built for you if…
Whether you're on day one or you've been testing in RSpec for years, the guide meets you where you are.
-
New to Rails testing
You know you should write tests but not where to start. We go step by step with plain language, scenarios, and one app so nothing feels random.
-
Coming from RSpec
You want to see how Minitest holds up on a real Rails app without switching frameworks mid-project. Same problems, default stack.
-
Adding tests at work
You need a pattern for mailers, jobs, auth, or an existing codebase. Use the chapter you need, or follow the full path when you have time.
What you'll work through
All 24 chapters are free. One Cookbook app. Start with the first six below, or open the full list when you're ready.
Introduction to Minitest Rails testing guide
Who this free Minitest Rails guide is for, and how it teaches Rails testing while sticking to the Rails defaults.
Setting up Minitest in Rails
Generate a Rails app with Minitest, enable system tests after Rails 8 defaults, and get a green suite with Capybara.
Types of tests in Rails
How model, controller, integration, and system tests fit together in Minitest, and when to pick each.
Testing tools for Minitest in Rails
Minitest, fixtures, Capybara, and when WebMock or VCR earns a place in a Rails test suite.
How to approach testing
Write scenarios in plain language, practice manual checks, and build a habit before you automate with Minitest.
Your first test
Write your first Rails Minitest model test, integration tests for list and create, and one system smoke test.
From the blog
All postsHow to Test User Registration with Minitest Rails
Test user sign-up in Rails with Minitest: model validations, integration coverage for valid and invalid registration, with a system smoke test for the happy path.
How to Test Rails Built-in Authentication with Minitest
Test Rails built-in authentication in Minitest: session fixtures, sign_in_as helpers, protected route integration tests, and system tests for sign-in and protected controllers.