spree-testing

spree-testing is a skill for Claude Code, Codex from spree/agent-skills. It costs 158 tokens per session (4,244 once invoked), scanned A, original, MIT.

A guide to automated testing for Spree Commerce applications. It uses RSpec for tests, Factory Bot for test data, Capybara for browser-based tests, and Spree-specific helpers.

In plain words
What is it for?
Use it to write model, controller, API-integration, admin-feature, and browser tests, including Spree factories, fixtures, authorization stubs, and shared test helpers.
Why use it?
It clarifies which testing tools and project conventions to use instead of Rails’ alternative Minitest and fixture setup.

Skill for Claude CodeCodex

Part of the spree plugin — 26 skills, 2 commands, 1 agent, 2 hooks shipped together

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.

agentmods
npx agentmods add skills/spree/agent-skills/spree-testing
Any agent
npx skills add spree/agent-skills --skill spree-testing
Clone the repo
git clone --depth 1 https://github.com/spree/agent-skills

Made for: Claude Code, Codex.

Or install spree, the plugin that ships this one along with the rest of its 26 skills, 2 commands, 1 agent, 2 hooks.

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 spree-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/spree/agent-skills/spree-testing.svg)](https://agentmods.dev/skills/spree/agent-skills/spree-testing)
Your own site
<a href="https://agentmods.dev/skills/spree/agent-skills/spree-testing"><img src="https://agentmods.dev/badge/skills/spree/agent-skills/spree-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 158 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,244 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00158 $0.04244
Opus 5 $0.00079 $0.02122
Sonnet 5 $0.00032 $0.00849
Haiku 4.5 $0.00016 $0.00424

Measured 4d ago against content hash 2113e27f9d4a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spree-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 4d 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.

skills/spree-testing/SKILL.md · 400 lines

How it starts

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

Spree Testing

Commands below use the Spree CLI form (spree …, Docker). On a classic Rails app without the CLI (typical pre-5.4), use the native mapping in the spree-project skill — bin/rails / bundle exec rake from the app root, paths without the backend/ prefix.

Spree's testing stack:

Tool Role
RSpec Test framework (not Minitest)
Factory Bot Test data (not fixtures)
Capybara Browser-driving feature tests
spree_dev_tools Spree-specific helpers (authorization stub, shared contexts, factory access)

If you've worked with vanilla Rails: drop test/, drop fixtures/, write under spec/ with RSpec instead. Spree gems use this stack consistently — your app should too.

Setup (one-time)

bin/rails g rspec:install            # creates spec/spec_helper.rb, spec/rails_helper.rb
bin/rails g spree_dev_tools:install  # adds Spree-specific helpers + shared contexts

spree_dev_tools is the key piece. It wires up:

  • stub_authorization! for admin controller/feature specs
  • Spree's core test helpers (factories, preferences, Capybara config)
  • Factory Bot configuration that auto-loads Spree's factories
  • Capybara driver setup for feature tests

For tests involving images/uploads, create a fixtures directory:

mkdir -p spec/fixtures/files
# add real file bytes — a 1x1 PNG is enough for most cases
printf '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR...' > spec/fixtures/files/logo.png

Pulling in Spree's factories

spree_dev_tools requires spree/testing_support/factories — the same factories Spree itself uses in its own specs (spree/core/lib/spree/testing_support/factories/). You get factories for every Spree model:

create(:store)           # Spree::Store
create(:product)         # Spree::Product (with default_variant, prices)
create(:variant)         # Spree::Variant
create(:order)           # Spree::Order
create(:order_with_line_items)
create(:completed_order_with_totals)
create(:user)            # Spree::User
create(:admin_user)
create(:shipping_method)
create(:tax_rate)
create(:promotion)
create(:payment_method)

Read the full file on GitHub · 400 lines

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. 4d ago First seen · 400 lines · 158 tokens per session scan A 2113e27f9d4a

Subscribe to this mod's changes

spree-testing is a skill published in the GitHub repository spree/agent-skills (4 stars, last pushed 1mo ago), licensed MIT. It adds 158 tokens to every session and 4,244 once invoked, about $0.0008 per session on Opus 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-31.

Related

Other skills, from other repositories

js-in-html-testing

Test JS logic embedded in HTML using two-layer strategy - Python unit tests + Playwright browser integration tests.

liaohch3/claude-tap · 25 tokens

designing-tests

Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.

CloudAI-X/claude-workflow-v2 · 48 tokens

check-and-test

Run lint checks (ruff for Python, Biome for TS/JS), type checks (pyright for Python, tsc for TS/JS), and the standard pytest tiers (unit + e2e + tests skipped during pre-commit). Investigates failures to determine if they are application bugs or test issues, and fixes application bugs rather than weakening tests. Does…

ReflexioAI/claude-smart · 97 tokens

qa/test-strategy

测试策略和测试金字塔原则,定义单元测试、集成测试、E2E测试的分布和覆盖要求.

echoVic/boss-skill · 33 tokens

prd-auto-test-loop

PRD 驱动的自动化测试编排技能。用于把每版 PRD 的测试计划、AI 自测与自修复、测试报告标准化落地;适用于按验收标准拆分 Unit/Integration/E2E、划分自动化与人工边界、生成版本化 TESTPLAN/TESTREPORT 的场景。.

yunshu0909/yunshu_skillshub · 79 tokens

run-tests

Run Portwood's test suites — the one-command QA harness, the anonymous-Apex e2e scripts, Apex unit tests, prettier, and Code Analyzer. Use before opening a PR, when verifying a fix, or when a test fails and you need to know whether it's your change or the harness.

Portwood-Global-Solutions/Portwood · 64 tokens