OSS TanbouSign in with GitHub

Describe and verify Rails models, HTTP responses, and browser behavior as specs

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
5,276
Primary language
Ruby
License
MIT
Repository last updated
Sep 28, 2026
On this page

Overview

This testing library integrates RSpec with Ruby on Rails so application behavior can be expressed and checked as specs. It provides spec types and matchers for models, requests, systems, jobs, mailers, and other Rails facilities. Generators create the initial configuration and boilerplate for application components.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Test Rails layers with purpose-specific spec types

Model, request, system, controller, view, routing, job, mailer, and other spec types cover different application boundaries. Rails TestCase facilities and test helpers are combined with RSpec expectations to check results, HTTP responses, and browser interactions.

Sources: [1]

Generate boilerplate and run a focused test scope

rails generate rspec:install creates configuration and helper files, while Rails generators can create matching specs for application components. bundle exec rspec can target the whole suite, a directory, one file, or an example at a line number.

Sources: [1]

Best fit

Share expected Rails behavior in executable specifications

It fits teams that want the same specification style from user-facing HTTP or browser behavior down to models and jobs. Request and system specs are especially useful when tests should cross Rails boundaries rather than isolate a controller implementation.

Sources: [1]

Before adoption

Select the major version that matches Rails and Ruby

v8.0.4 targets Rails 8.0 or 7.2, and its gemspec requires Ruby 3.0 or newer plus Rails 7.2 or newer. The selected Rails release may impose a higher Ruby requirement. Older Rails applications need the corresponding earlier major. Removing Rails or Ruby support is treated as a breaking change, so review upgrade notes and the changelog before moving between majors.

Sources: [1][2][4][3]

Official sources

  1. [1]RSpec Rails v8.0.4 README(2026-10-04)
  2. [2]RSpec Rails v8.0.4 gem specification(2026-10-04)
  3. [3]RSpec Rails v8.0.4 changelog(2026-10-04)
  4. [4]RSpec Rails versioning strategy(2026-10-04)
  5. [5]RSpec Rails GitHub repository metadata(2026-10-04)
  6. [6]RSpec Rails v8.0.4 MIT license(2026-10-04)
Supplemental curator note

Choose each spec type by the boundary a failure should identify. Request specs fit HTTP behavior, while system specs fit user interactions; adding every layer by habit can make the suite slower and harder to diagnose.

Try it in 3 steps

  1. 1

    Add RSpec Rails to an existing Rails application

    Run this at the root of an evaluation app using Rails 8.0 or 7.2 and a Ruby version supported by that Rails release. Bundler updates the Gemfile and installs dependencies.

    bundle add rspec-rails --version 8.0.4 --group development,test
  2. 2

    Generate the RSpec configuration

    Generate .rspec, spec/spec_helper.rb, and spec/rails_helper.rb.

    bundle exec rails generate rspec:install
  3. 3

    Run a minimal spec that loads Rails

    Create a small spec and confirm that it passes while loading the Rails test environment.

    mkdir -p spec/models && printf '%s\n' "require 'rails_helper'" "RSpec.describe 'smoke' do" " it 'runs inside Rails' do" " expect(Rails.env.test?).to be(true)" " end" "end" > spec/models/smoke_spec.rb && bundle exec rspec spec/models/smoke_spec.rb
Check the official README

Growth

Growth trends · Last 30 days

5,276 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
6
Open PRs
20

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data
Stars
5,276
Forks
1,045
Watchers
87
Open issues
44
Contributors
368
Owner type
Organization
Primary language
Ruby
License
MIT
Repository last updated
Sep 28, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?