跳到正文
FunCoding

37signals-testing

Test Rails apps the 37signals way - Minitest and fixtures only, a deliberate coverage budget (heavy on models and controllers, few system tests, no view or JS unit tests), and fixture patterns from Campfire and Fizzy. Use alongside rails-testing in apps that use Minitest + fixtures, or when the user asks how 37signals tests.

Star
749
最近提交
2026年11月30日

skills/37signals-testing/SKILL.md

在 GitHub 上查看

37signals Testing

The opinionated layer on top of rails-testing. Patterns from the Campfire and Fizzy test suites.

Defaults

  • Minitest + fixtures. No RSpec, no FactoryBot.
  • Tests ship in the same commit/PR as the feature: not before, not later.

Coverage Budget (where 37signals actually spends)

  • Heavy: model tests (domain invariants, concerns) and controller/integration tests (full request cycle, auth, formats).
  • Light: a few system tests for the critical happy paths (one smoke test can cover signup→use); job tests only for jobs with real logic.
  • None: view tests, JS/Stimulus unit tests, exhaustive channel tests. UI behavior is covered indirectly by system tests.

Fixtures

  • Express relationships by label, not ID; use ERB for relative timestamps (created_at: <%= 1.hour.ago %>) and shared computed values (one bcrypt digest reused).
  • Mirror app/models structure in test/models: app/models/card/closeable.rb ↔ test/models/card/closeable_test.rb; shared concerns under test/models/concerns/.
  • UUID PKs break fixture ordering: generate deterministic, label-derived UUIDv7s in fixtures so .first/.last are stable and runtime records are always newer.
  • Build rich-content fixtures with production code (ActionText::Attachment.from_attachable(user).to_html), not hand-written markup.

Red Flags

  • Factories or per-test record setup where a fixture would do.
  • View tests or Stimulus unit tests (cover the behavior with a system test instead).

相似的 Skill

reverse-engineer-anything

MOmorluto/rea486k近 7 天新增 8,943 个 star

reverse-engineer-anything

MOmorluto/rea486k近 7 天新增 8,943 个 star

test-driven-development

OBobra/superpowers331k近 7 天新增 4,772 个 star

精选

accessibility

审计 Web、iOS、Android 的无障碍合规,支持键盘导航与屏幕阅读器。

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

ai-regression-testing

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

agent-runtime-gateway-smoke-test

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star