# RSpec Tests in Ruby on Rails: Every Spec Type Explained (2026)

DevFeed: [RSpec Tests in Ruby on Rails: Every Spec Type Explained (2026)](<https://devfeed.tech/articles/rspec-tests-in-ruby-on-rails-every-spec-type-explained-2026-90803.md>)

Original publisher: [Read original article](<https://blog.appsignal.com/2024/02/07/a-deep-dive-into-rspec-tests-in-ruby-on-rails.html>)

Author: Thomas Riboulet

Published: 2024-02-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [AppSignal](<https://devfeed.tech/sources/appsignal.md>)

Topics: [RSpec](<https://devfeed.tech/topics/rspec.md>), [Ruby on Rails](<https://devfeed.tech/topics/ruby-on-rails.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Sidekiq](<https://devfeed.tech/topics/sidekiq.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [job](<https://devfeed.tech/tags/job.md>), [model](<https://devfeed.tech/tags/model.md>), [rails](<https://devfeed.tech/tags/rails.md>), [request](<https://devfeed.tech/tags/request.md>), [rspec](<https://devfeed.tech/tags/rspec.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [ruby-on-rails](<https://devfeed.tech/tags/ruby-on-rails.md>), [spec](<https://devfeed.tech/tags/spec.md>), [system](<https://devfeed.tech/tags/system.md>), [tests](<https://devfeed.tech/tags/tests.md>)

## AI overview

The article recommends keeping Rails tests fast by testing models and plain Ruby objects with many focused unit specs, avoiding database access where possible. Use request specs for HTTP behavior across routing, middleware, controllers, and views; they are preferred over legacy controller specs and suit APIs. Reserve slower Capybara system specs for important user flows. The default Selenium driver can run browser tests, while `:rack_test` is faster but does not execute JavaScript; JavaScript flows need a browser driver. Mailer specs should check email headers and content without delivery, and job specs should check whether application code enqueues the right job, queue, and arguments. It also describes installing `rspec-rails` with the Rails generator and notes version 8 supports Rails 7.2 and later.

## Source excerpt

Learn every spec type rspec-rails supports on Rails 8: model, request, system, mailer, and job specs, with setup steps and runnable examples for each.