rails-testing-best-practices

📁 pproenca/dot-skills 📅 2 days ago
1
总安装量
1
周安装量
#45594
全站排名
安装命令
npx skills add https://github.com/pproenca/dot-skills --skill rails-testing-best-practices

Agent 安装分布

amp 1
opencode 1
kimi-cli 1
codex 1
github-copilot 1
claude-code 1

Skill 文档

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

Priority Category Impact Prefix
1 Test Design & Structure CRITICAL design-
2 Test Data Management CRITICAL data-
3 Model Testing HIGH model-
4 Request & Controller Testing HIGH request-
5 System & Acceptance Testing MEDIUM-HIGH system-
6 Async & Background Job Testing MEDIUM async-
7 Test Performance & Reliability MEDIUM perf-
8 Test Organization & Maintenance LOW-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

File Description
references/_sections.md Category definitions and ordering
assets/templates/_template.md Template for new rules
metadata.json Version and reference information