Skillshub rails-testing

Community Ruby on Rails Testing Best Practices

install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/rails-testing" ~/.claude/skills/comeonoliver-skillshub-rails-testing && rm -rf "$T"
manifest: skills/pproenca/dot-skills/rails-testing/SKILL.md
source content

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 & StructureCRITICAL
design-
2Test Data ManagementCRITICAL
data-
3Model TestingHIGH
model-
4Request & Controller TestingHIGH
request-
5System & Acceptance TestingMEDIUM-HIGH
system-
6Async & Background Job TestingMEDIUM
async-
7Test Performance & ReliabilityMEDIUM
perf-
8Test Organization & MaintenanceLOW-MEDIUM
org-

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