算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
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, Cap…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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.
Reference these guidelines when:
| 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- |
design-four-phase-test - Use four-phase test structure (setup, exercise, verify, teardown)design-behavior-over-implementation - Test observable behavior, not internal implementationdesign-one-assertion-per-test - One logical expectation per test for precise failure diagnosisdesign-descriptive-test-names - Write test names that read like specificationsdesign-avoid-mystery-guest - Make all test data visible within the test itselfdesign-avoid-conditional-logic - No if/else or loops in test codedesign-explicit-subject - Name subjects explicitly instead of using implicit subjectdata-factory-traits - Use composable factory traits instead of separate factoriesdata-minimal-attributes - Specify only attributes relevant to the testdata-build-over-create - Prefer build/build_stubbed over create when persistence isn't neededdata-avoid-fixture-coupling - Use factories instead of shared fixturesdata-transient-attributes - Use transient attributes for complex factory setupdata-sequence-unique-values - Use sequences for uniqueness-constrained fieldsmodel-test-validations - Test validations with boundary cases, not just happy pathmodel-test-associations - Test associations explicitly including dependent behaviormodel-test-scopes - Test scopes with matching and non-matching recordsmodel-test-callbacks-sparingly - Test callback side effects, not callback existencemodel-test-custom-methods - Test public methods with input/output pairs across scenariosmodel-avoid-testing-framework - Don't test ActiveRecord or framework behaviormodel-test-enums - Test enum transitions and generated scopesrequest-over-controller-specs - Use request specs over deprecated controller specsrequest-test-response-status - Assert HTTP status codes explicitlyrequest-test-authentication - Test authentication boundaries for every protected endpointrequest-test-authorization - Test authorization for each rolerequest-test-params-validation - Test parameter validation and edge casesrequest-json-response-structure - Assert JSON response structure for API endpointssystem-page-objects - Encapsulate page interactions in page objectssystem-use-accessible-selectors - Use accessible selectors over CSS/XPathsystem-avoid-sleep - Never use sleep — rely on Capybara's built-in waitingsystem-test-critical-paths - Reserve system tests for critical user journeyssystem-database-state - Use truncation strategy for system test database cleanupsystem-screenshot-on-failure - Capture screenshots on system test failureasync-separate-enqueue-from-perform - Test enqueue and perform separatelyasync-use-fake-mode-default - Default to Sidekiq fake mode globallyasync-test-job-perform - Test job perform method directlyasync-test-mailer-delivery - Test mailer delivery with enqueued mail matcherasync-test-after-commit - Account for transaction-aware job enqueuing in Rails 7.2+perf-parallel-tests - Run tests in parallel across CPU coresperf-database-strategy - Use transaction strategy for non-system testsperf-profile-slow-specs - Profile and fix the slowest specsperf-quarantine-flaky-tests - Quarantine flaky tests instead of retryingperf-avoid-before-all-mutation - Never mutate state created in before(:all)org-avoid-deep-nesting - Limit context nesting to 3 levelsorg-shared-examples-sparingly - Use shared examples only for true behavioral contractsorg-custom-matchers - Extract custom matchers for repeated domain assertionsorg-file-structure-mirrors-app - Mirror app directory structure in spec directoryRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |