RSpec Tests in Ruby on Rails: Every Spec Type Explained (2026)
RSpec is the most widely used testing framework for Ruby on Rails. With the rspec-rails gem (v8.x, supporting Rails 7.2–8.x), you write model specs for business logic, request specs for controllers and APIs, and system specs for browser flows — plus mailer and job specs. Run the suite with bundle exec rspec. In the first part of this series, we looked at the basics of RSpec and how well it works with Behavior Driven Development in Ruby.