// the find
eliotsykes/rspec-rails-examples
RSpec cheatsheet & Rails app: Learn how to expertly test Rails apps from a model codebase
A Rails app that exists purely as a working RSpec reference — every testing pattern you'd want for a Rails project is demonstrated with a real app behind it, not contrived snippets. It covers model, controller, mailer, feature, job, and API specs alongside support configuration for DatabaseCleaner, FactoryGirl, Capybara, VCR, and Shoulda-Matchers. Aimed at developers who learn better from reading passing tests than from docs.
The support/ directory is the real value — each file is a self-contained, well-commented setup guide for a specific gem (DatabaseCleaner, VCR, Puffing Billy) rather than a monolithic config blob. Custom matcher examples show the full pattern from definition to use, including chainable matchers, which most tutorials skip. The error_responses.rb support file for testing production-like error handling is a specific, non-obvious problem that most Rails test suites get wrong. Factory patterns are shown in context of real model associations rather than isolated examples.
Last touched July 2020 and it shows: FactoryGirl was renamed FactoryBot in 2017, this repo still uses the old name throughout. Controller specs are included but RSpec Rails has been pushing request specs as the replacement for years — this muddies the guidance for someone new to the ecosystem. The Rails version in Gemfile.lock is almost certainly Rails 4 or 5 era, meaning several patterns (system specs, zeitwerk loading, importmaps) that matter in modern Rails apps are entirely absent. Travis CI badge is likely dead.