The confusing parts of Rails testing, clearly explained.
Beginner-friendly lessons on RSpec, Capybara, Factory Bot, testing strategy, and more.
Getting Started
with Rails Testing
Learn the different types of tests and what type of features to write tests for.
Capybara and
System Specs
Learn how to write tests that simulate clicks and keystrokes in the browser.
RSpec Syntax
Learn the domain-specific language (DSL) in which all RSpec tests are written.
Factory Bot
Learn how to conveniently generate data for your tests using this popular library.
Browse Most Popular Articles
A Rails testing "hello world" using RSpec and Capybara
Shows the simplest possible example of using RSpec and Capybara in a Rails application.A repeatable formula for writing Rails integration tests with Capybara
Don't get stumped on test implementation. Follow this repeatable step-by-step formula.Why I recommend against Cucumber
Cucumber is a popular tool but it doesn't add much value. It mostly just adds noise.RSpec mocks and stubs in plain English
Mocks and stubs can be confusing. This article explains what they are and what the difference is.
About the Author
I'm Jason Swett. I'm a blogger on the topic of Ruby on Rails testing, with articles regularly featured in Ruby Weekly. I'm an international conference speaker and the host of the Code with Jason podcast.