testing-patterns

Generate Rails Minitest patterns for models, controllers, jobs, and mailers.

1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/LaunchPadLab/ai-bank --skill testing-patterns-launchpadlab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/LaunchPadLab/ai-bank/tree/main/claude/skills/testing-patterns
Command: npx skills add https://github.com/LaunchPadLab/ai-bank --skill testing-patterns-launchpadlab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you choose the right Rails test type and apply consistent verification patterns so your test suite stays reliable, clear, and resilient against brittle assertions.

Core Features & Use Cases

  • Test type selection guidance: Maps behaviors to model, unit, integration, system, job, mailer, component, and policy tests by risk and location.
  • Practical Rails Minitest examples: Provides reusable snippets for validations, scopes, integration flows, system flows, Active Job email assertions, and mailer delivery assertions.
  • Debugging flaky tests and safer verification: Recommends ordering tests for focused diagnosis and using time helpers, controlled stubs, and fixture naming conventions to keep tests deterministic.
  • Verification-first workflow: Encourages running the smallest focused test first, then widening coverage only when wiring or user-visible workflow risk is involved.

Quick Start

Use the testing-patterns skill to design and write a Rails Minitest test that covers a flaky board-creation flow with the narrowest possible test type.

Frequently Asked Questions about testing-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right Rails Minitest type for testing a specific behavior?

To choose the right Rails Minitest type, you map behaviors to model, unit, integration, system, job, or mailer tests based on risk and location. This guidance ensures reliable and clear verification patterns for your test suite.

What's the best way to write Minitest integration tests for Active Job and mailer workflows?

The best way to write Minitest integration tests for Active Job and mailer workflows is using reusable snippets for email delivery assertions and job queue assertions. These patterns apply controlled stubs and fixture naming conventions to keep tests deterministic.

Why does my Rails system test behave flaky and how can I fix it?

Rails system tests behave flaky due to brittle assertions and uncontrolled dependencies. Fix flaky behavior by ordering tests for focused diagnosis, using time helpers, applying controlled stubs, and following fixture naming conventions to ensure deterministic verification.

When do I need a system test instead of an integration test in Rails?

You need a system test instead of an integration test in Rails when verifying user-visible workflow risks and UI flows. A verification-first workflow encourages running the smallest focused integration test first, then widening to system tests only when wiring risk is involved.

Can I use these testing patterns to refactor Rails test code without changing behavior?

Yes, you can use these testing patterns to refactor Rails test code safely without changing behavior. The patterns provide structured guidance and example snippets that satisfy deterministic verification, ensuring your refactoring maintains the original test coverage.