rspec-testing

rspec-testing is a skill for Claude Code from dgalarza/claude-code-workflows. It costs 68 tokens per session (3,366 once invoked), scanned A, original, MIT.

A testing skill for RSpec, the testing framework commonly used with Ruby on Rails. It covers tests for models, controllers, full browser-like flows, components, services, and integrations, including the red-green-refactor TDD cycle.

In plain words
What is it for?
Use it when writing, reviewing, or improving Rails RSpec tests, including test data setup, expected outcomes, user flows, and test coverage.
Why use it?
It helps make tests easier to understand and maintain while checking real application behavior instead of only internal implementation details.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rails-toolkit plugin — 2 skills, 2 commands, 4 agents shipped together

Good fit Use it when writing, reviewing, or improving Rails RSpec tests, including test data setup, expected outcomes, user flows, and test coverage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dgalarza/claude-code-workflows/rspec-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dgalarza/claude-code-workflows --skill rspec-testing
Clone the repo
git clone --depth 1 https://github.com/dgalarza/claude-code-workflows

Made for: Claude Code.

Or install rails-toolkit, the plugin that ships this one along with the rest of its 2 skills, 2 commands, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rspec-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/dgalarza/claude-code-workflows/rspec-testing/github.svg)](https://agentmods.dev/skills/dgalarza/claude-code-workflows/rspec-testing)
Your own site
<a href="https://agentmods.dev/skills/dgalarza/claude-code-workflows/rspec-testing"><img src="https://agentmods.dev/badge/skills/dgalarza/claude-code-workflows/rspec-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rspec-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/dgalarza/claude-code-workflows/rspec-testing"><img src="https://agentmods.dev/badge/skills/dgalarza/claude-code-workflows/rspec-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,366 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.03366
Opus 5.5 $0.00027 $0.01346
Sonnet 5.5 $0.00014 $0.00673
Haiku 4.5 $0.00007 $0.00337

Measured 1mo ago against content hash cc42bdb55278, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rspec-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/rails-toolkit/skills/rspec-testing/SKILL.md · 573 lines

How it starts

The opening of the file, as written. The whole thing — 573 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RSpec Testing for Rails

Overview

Write comprehensive, maintainable RSpec tests following industry best practices. This skill combines guidance from Better Specs and thoughtbot's testing guides to produce high-quality test coverage for Rails applications.

Core Testing Principles

1. Test-Driven Development (TDD)

Follow the Red-Green-Refactor cycle:

  • Red: Write failing tests that define expected behavior
  • Green: Implement minimal code to make tests pass
  • Refactor: Improve code while tests continue to pass

2. Test Structure (Arrange-Act-Assert)

Organize tests with clear phases separated by newlines:

it 'creates a new article' do
  # Arrange - set up test data
  user = create(:user)
  attributes = {title: 'Test Article', body: 'Content here'}

  # Act - perform the action
  article = Article.create(attributes)

  # Assert - verify the outcome
  expect(article).to be_persisted
  expect(article.title).to eq('Test Article')
end

3. Single Responsibility

Each test should verify one behavior. For unit tests, use one expectation per test. For integration tests, multiple expectations are acceptable when testing a complete flow.

4. Test Real Behavior

Avoid over-mocking. Test actual application behavior when possible. Only stub external services, slow operations, and dependencies outside your control.

Test Type Decision Tree

When to Write Model Specs

Use model specs (spec/models/) for:

  • Validations
  • Associations
  • Scopes
  • Instance methods
  • Class methods
  • Enums and constants
  • Database constraints

Example:

# spec/models/article_spec.rb
RSpec.describe Article do
  describe 'validations' do
    it 'validates presence of title' do
      article = build(:article, title: nil)
      expect(article).not_to be_valid
      expect(article.errors[:title]).to include("can't be blank")
    end
  end

  describe 'associations' do
    it { is_expected.to belong_to(:user) }
    it { is_expected.to have_many(:comments) }
  end

  describe '#published?' do
    it 'returns true when status is published' do
      article = build(:article, status: :published)
      expect(article.published?).to be true
    end
  end
end

Read the full file on GitHub · 573 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 573 lines · 68 tokens per session scan A cc42bdb55278

Subscribe to this mod's changes

rspec-testing is a skill published in the GitHub repository dgalarza/claude-code-workflows (62 stars, last pushed yesterday), licensed MIT. It adds 68 tokens to every session and 3,366 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

rust-testing

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

affaan-m/ECC · 31 tokens

golang-testing

Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.

affaan-m/ECC · 37 tokens

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

java-affected-tests

Use before opening or updating an OpenMetadata PR that changes Java, a JSON schema, an index mapping, a SQL migration, seed data or a pom — PR CI no longer runs the Java integration tests (they run only in the merge queue) and the JavaUIIT/search-it suites run only nightly, so this selects the unit tests and…

open-metadata/OpenMetadata · 120 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

dotnet/skills · 149 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens