Rails Testing

Detect Rails testing frameworks and generate RSpec or Minitest patterns.

1|Updated Jan 1, 2026
One-click install
npx skills add https://github.com/betamatt/claude-plugins --skill rails-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Rails Testing
Source: https://github.com/betamatt/claude-plugins/tree/main/ruby-on-rails/skills/rails-testing
Command: npx skills add https://github.com/betamatt/claude-plugins --skill rails-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Rails testing guidance tailored for production apps in Rails 7+ projects, supporting RSpec and Minitest with framework-aware patterns. It helps teams implement robust test suites by automatically detecting the project's testing framework and applying appropriate patterns.

Core Features & Use Cases

  • Framework detection and framework-specific patterns for RSpec and Minitest across models, controllers, API tests, and system specs.
  • Shared examples, factories (FactoryBot), helpers, and test structure guidance to promote consistency and maintainability.
  • Use cases include building maintainable model specs, controller/request specs, and reliable system tests with end-to-end flow validation.

Quick Start

Apply production-ready Rails testing patterns to your project using RSpec and Minitest.

Frequently Asked Questions about Rails Testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up shared examples and FactoryBot in Rails testing?

To set up Rails testing, configure FactoryBot and define shared examples within your support files to ensure maintainable and consistent test structures across model, controller, and system specs.

What is the best way to write system specs for Rails 7+ applications?

Writing system specs for Rails 7+ involves applying framework-aware patterns to validate end-to-end flows, ensuring reliable browser-level testing using either RSpec or Minitest configurations.

Does this Rails testing guidance work with both RSpec and Minitest?

Yes, this Rails testing guidance supports both RSpec and Minitest by automatically detecting the project's active testing framework from the spec or test directory and applying appropriate framework-specific patterns.

How do I structure API and request specs in a Rails project?

To structure API and request specs in a Rails project, use framework-aware patterns to validate endpoints, applying shared examples and helpers to maintain consistency across your RSpec or Minitest suites.

When do I need to configure support files for Rails testing?

You need to configure support files for Rails testing when implementing shared examples, factories, and custom helpers, ensuring your spec or test directory promotes consistency and maintainability across your suite.