Individual skill
rails-testing
Ruby on Rails testing best practices for writing effective, maintainable test suites with RSpec. This skill should be used when writing, reviewing, or refactoring Rails tests to ensure proper test design, data management, and coverage patterns. Triggers on tasks involving RSpec specs, model tests, request specs, system tests, factory definitions, Capybara interactions, Sidekiq job tests, or test suite optimization. Complementary to rails-dev, ruby-optimise, and ruby-refactor skills.
skills/.curated/rails-testing/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- Yes
- Observed behavior
- Not checked yet
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 222
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- testing Derived category
- engineering Derived category
- design Derived category
- writing Derived category
- data Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 204 bytesSKILL.mdcore · 8,510 bytesassets/templates/_template.mddoc · 625 bytesmetadata.jsonasset · 1,291 bytesreferences/_sections.mddoc · 2,379 bytesreferences/async-separate-enqueue-from-perform.mddoc · 2,946 bytesreferences/async-test-after-commit.mddoc · 2,978 bytesreferences/async-test-job-perform.mddoc · 2,331 bytesreferences/async-test-mailer-delivery.mddoc · 3,115 bytesreferences/async-use-fake-mode-default.mddoc · 2,705 bytesreferences/data-avoid-fixture-coupling.mddoc · 2,851 bytesreferences/data-build-over-create.mddoc · 2,807 bytesreferences/data-factory-traits.mddoc · 2,265 bytesreferences/data-minimal-attributes.mddoc · 2,111 bytesreferences/data-sequence-unique-values.mddoc · 2,282 bytesreferences/data-transient-attributes.mddoc · 2,768 bytesreferences/design-avoid-conditional-logic.mddoc · 2,310 bytesreferences/design-avoid-mystery-guest.mddoc · 2,512 bytesreferences/design-behavior-over-implementation.mddoc · 2,520 bytesreferences/design-descriptive-test-names.mddoc · 2,361 bytesreferences/design-explicit-subject.mddoc · 2,406 bytesreferences/design-four-phase-test.mddoc · 2,625 bytesreferences/design-one-assertion-per-test.mddoc · 2,794 bytesreferences/model-avoid-testing-framework.mddoc · 2,994 bytesreferences/model-test-associations.mddoc · 2,346 bytesreferences/model-test-callbacks-sparingly.mddoc · 2,766 bytesreferences/model-test-custom-methods.mddoc · 3,505 bytesreferences/model-test-enums.mddoc · 3,433 bytesreferences/model-test-scopes.mddoc · 2,753 bytesreferences/model-test-validations.mddoc · 2,857 bytesreferences/org-avoid-deep-nesting.mddoc · 3,304 bytesreferences/org-custom-matchers.mddoc · 3,789 bytesreferences/org-file-structure-mirrors-app.mddoc · 3,320 bytesreferences/org-shared-examples-sparingly.mddoc · 3,650 bytesreferences/perf-avoid-before-all-mutation.mddoc · 3,048 bytesreferences/perf-database-strategy.mddoc · 2,167 bytesreferences/perf-parallel-tests.mddoc · 2,135 bytesreferences/perf-profile-slow-specs.mddoc · 3,270 bytesreferences/perf-quarantine-flaky-tests.mddoc · 2,716 bytesreferences/request-json-response-structure.mddoc · 4,070 bytesreferences/request-over-controller-specs.mddoc · 2,379 bytesreferences/request-test-authentication.mddoc · 2,962 bytesreferences/request-test-authorization.mddoc · 3,737 bytesreferences/request-test-params-validation.mddoc · 3,929 bytesreferences/request-test-response-status.mddoc · 3,250 bytesreferences/system-avoid-sleep.mddoc · 2,691 bytesreferences/system-database-state.mddoc · 2,540 bytesreferences/system-page-objects.mddoc · 2,713 bytesreferences/system-screenshot-on-failure.mddoc · 2,680 bytesreferences/system-test-critical-paths.mddoc · 3,198 bytesreferences/system-use-accessible-selectors.mddoc · 2,127 bytes
Read excerpt
# 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