rspec-testing

rspec-testing is a skill for Claude Code, Codex from Shoebtamboli/rails_claude_skills. It costs 68 tokens per session (3,366 once invoked), scanned A, a copy of rspec-testing, MIT.

A guide for writing and reviewing RSpec tests in Ruby on Rails applications. RSpec is a Ruby testing framework; the guide uses test-driven development, or TDD, where tests are written before and alongside the code they check.

In plain words
What is it for?
Use it for model, controller, system, component, service, and integration tests, including test setup, actions, expected results, and refactoring.
Why use it?
It helps developers structure tests clearly, test real behavior, and improve code while keeping the tests passing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for model, controller, system, component, service, and integration tests, including test setup, actions, expected results, and refactoring.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shoebtamboli/rails_claude_skills/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 Shoebtamboli/rails_claude_skills --skill rspec-testing
Clone the repo
git clone --depth 1 https://github.com/Shoebtamboli/rails_claude_skills

Made for: Claude Code, Codex.

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/shoebtamboli/rails_claude_skills/rspec-testing/github.svg)](https://agentmods.dev/skills/shoebtamboli/rails_claude_skills/rspec-testing)
Your own site
<a href="https://agentmods.dev/skills/shoebtamboli/rails_claude_skills/rspec-testing"><img src="https://agentmods.dev/badge/skills/shoebtamboli/rails_claude_skills/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/shoebtamboli/rails_claude_skills/rspec-testing"><img src="https://agentmods.dev/badge/skills/shoebtamboli/rails_claude_skills/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.
Origin 100% copy Near-identical to another mod 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 $0.00034 $0.01683
Sonnet 5 $0.00014 $0.00673
Haiku 4.5 $0.00007 $0.00337

Measured 11d ago against content hash cc42bdb55278, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 11d 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

This is a copy

100% identical to rspec-testing — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

lib/generators/claude/skills_library/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. 11d 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 Shoebtamboli/rails_claude_skills (16 stars, last pushed 2mo ago), licensed MIT. It adds 68 tokens to every session and 3,366 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to rspec-testing, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

laravel-testing

Use when testing controllers, services, or models, or implementing TDD on Laravel 13 with Pest 4 / PHPUnit 12.

fusengine/agents · 31 tokens

test-writer

Write thorough tests following TDD and BDD principles.

athola/skrills · 14 tokens

test-driven-development

Use when practicing TDD. Covers the red-green-refactor loop, choosing the next test, designing through tests, and when TDD is and is not the right approach.

nimadorostkar/Claude-Skills-collection · 39 tokens

test-strategy

Use when deciding what to test and at which level. Covers the test pyramid, what belongs in unit versus integration versus end-to-end tests, coverage as a signal rather than a target, and eliminating flakiness.

nimadorostkar/Claude-Skills-collection · 47 tokens

test-driven-development

Guides TDD (test-driven development) with red-green-refactor workflows, test-first feature delivery, bug reproduction through failing tests, behavior-focused assertions, and refactoring safety. Use when writing unit tests, implementing new functions, adding test coverage, fixing regressions, changing APIs, or…

pantheon-org/tekhne · 87 tokens

testing-expert

Ultimate Kotlin testing skill. Use this whenever writing, reviewing, or debugging ANY Kotlin test — unit, integration, property-based, or coroutine. Covers TDD (RED/GREEN/REFACTOR), Kotest + MockK + Kover, anti-pattern detection, and four-pillar quality framework. Triggers on: write a test, add coverage, why is this…

JosephSanjaya/skills · 115 tokens