mcpField
R
rails-testing

rails-testing

github.com/pproencaTesting & quality218297 installsUpdated 11w ago
Repository

About rails-testing

rails-testing is a community-maintained guide to testing Ruby on Rails applications. Its prioritized rules cover test design, data setup, reliability, and performance for developers writing or reviewing test suites.

Key features

  1. 0146 prioritized rules in 8 categories
  2. 02RSpec and FactoryBot testing guidance
  3. 03Request and system test practices
  4. 04Background job testing guidance
  5. 05Suite performance and reliability rules

Use cases

  1. 01Writing RSpec tests for Rails features
  2. 02Reviewing tests for flaky patterns
  3. 03Improving CI test suite performance

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill rails-testing

After installing, type/rails-testingin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
async-separate-enqueue-from-perform.md
async-test-after-commit.md
async-test-job-perform.md
async-test-mailer-delivery.md
async-use-fake-mode-default.md
data-avoid-fixture-coupling.md
data-build-over-create.md
data-factory-traits.md
data-minimal-attributes.md
data-sequence-unique-values.md
data-transient-attributes.md
design-avoid-conditional-logic.md
design-avoid-mystery-guest.md
design-behavior-over-implementation.md
design-descriptive-test-names.md
design-explicit-subject.md
design-four-phase-test.md
design-one-assertion-per-test.md
model-avoid-testing-framework.md
model-test-associations.md
model-test-callbacks-sparingly.md
model-test-custom-methods.md
model-test-enums.md
model-test-scopes.md
model-test-validations.md
org-avoid-deep-nesting.md

Details

From the project README

Community Ruby on Rails Testing Best Practices

Comprehensive testing guide for Ruby on Rails applications, maintained by Community. Contains 46 rules across 8 categories, prioritized by impact to guide automated test generation, review, and refactoring.

When to Apply

Reference these guidelines when:

  • Writing new RSpec specs for models, requests, system tests, or jobs
  • Setting up FactoryBot factories with traits and sequences
  • Writing Capybara system tests for user journeys
  • Testing background jobs with Sidekiq or Active Job
  • Reviewing test code for anti-patterns (mystery guests, flaky tests, slow specs)
  • Optimizing test suite performance and CI pipeline speed
  • Organizing test files, shared examples, and custom matchers

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Test Design & StructureCRITICALdesign-
2Test Data ManagementCRITICALdata-
3Model TestingHIGHmodel-
4Request & Controller TestingHIGHrequest-
5System & Acceptance TestingMEDIUM-HIGHsystem-
6Async & Background Job TestingMEDIUMasync-
7Test Performance & ReliabilityMEDIUMperf-
8Test Organization & MaintenanceLOW-MEDIUMorg-

Quick Reference

1. Test Design & Structure (CRITICAL)
2. Test Data Management (CRITICAL)
3. Model Testing (HIGH)
4. Request & Controller Testing (HIGH)
5. System & Acceptance Testing (MEDIUM-HIGH)
6. Async & Background Job Testing (MEDIUM)
7. Test Performance & Reliability (MEDIUM)
8. Test Organization & Maintenance (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported