inertia-rails-testing

inertia-rails-testing is a skill for Claude Code, Codex from thecodingend/rails-starter. It costs 128 tokens per session (1,551 once invoked), scanned A, a copy of inertia-rails-testing, MIT.

A testing guide for Ruby on Rails applications that use Inertia, a system for sending server-generated page data to a browser interface. It covers tests written with RSpec or Minitest.

In plain words
What is it for?
It helps write controller, request, and integration tests for Inertia pages, including component checks, property matching, flash messages, deferred data, and partial page reloads.
Why use it?
It helps test what page a controller renders, which data and messages it sends, and whether private data is missing. It also avoids checking the wrong response when a request redirects before showing the page.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit It helps write controller, request, and integration tests for Inertia pages, including…

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

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 inertia-rails-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/thecodingend/rails-starter/inertia-rails-testing.svg)](https://agentmods.dev/skills/thecodingend/rails-starter/inertia-rails-testing)
Your own site
<a href="https://agentmods.dev/skills/thecodingend/rails-starter/inertia-rails-testing"><img src="https://agentmods.dev/badge/skills/thecodingend/rails-starter/inertia-rails-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,551 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.00128 $0.01551
Opus 5 $0.00064 $0.00776
Sonnet 5 $0.00026 $0.00310
Haiku 4.5 $0.00013 $0.00155

Measured 6d ago against content hash a527ef9463eb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

inertia-rails-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 6d 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 inertia-rails-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.

.agents/skills/inertia-rails-testing/SKILL.md · 177 lines

How it starts

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

Inertia Rails Testing

Testing patterns for Inertia responses with RSpec and Minitest.

For each controller action, verify:

  • Correct componentrender_component('users/index')
  • Expected propshave_props(users: satisfy { ... })
  • No leaked datahave_no_prop(:secret)
  • Flash messagesfollow_redirect! then have_flash(notice: '...')
  • Deferred propshave_deferred_props(:analytics)

Common mistake: Forgetting follow_redirect! after PRG — without it, you're asserting against the 302 redirect response, not the Inertia page that follows.

Setup

# spec/rails_helper.rb
require 'inertia_rails/rspec'

RSpec Matchers

Matcher Purpose
be_inertia_response Verify response is Inertia format
render_component('path') Check rendered component name
have_props(key: value) Partial props match
have_exact_props(key: value) Exact props match
have_no_prop(:key) Assert prop absent
have_flash(key: value) Partial flash match
have_exact_flash(key: value) Exact flash match
have_no_flash(:key) Assert flash absent
have_deferred_props(:key) Check deferred props exist
have_view_data(key: value) Partial view_data match

RSpec Examples

ALWAYS use matchers (render_component, have_props, have_flash) instead of direct property access (inertia.component, inertia.props[:key]):

# BAD — direct property access:
# expect(inertia.component).to eq('users/index')
# expect(inertia.props[:users].length).to eq(3)

# GOOD — use matchers:
expect(inertia).to render_component('users/index')
expect(inertia).to have_props(users: satisfy { |u| u.length == 3 })
# Key pattern: follow_redirect! after POST/PATCH/DELETE before asserting
it 'redirects with flash on success' do
  post users_path, params: { user: valid_params }

  expect(response).to redirect_to(users_path)
  follow_redirect!
  expect(inertia).to have_flash(notice: 'User created!')
end

it 'returns validation errors on failure' do
  post users_path, params: { user: { name: '' } }

  follow_redirect!
  expect(inertia).to have_props(errors: hash_including('name' => anything))
end

Read the full file on GitHub · 177 lines

Files

What ships with it

1 file 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. 6d ago First seen · 177 lines · 128 tokens per session scan A a527ef9463eb

Subscribe to this mod's changes

inertia-rails-testing is a skill published in the GitHub repository thecodingend/rails-starter (5 stars, last pushed 5d ago), licensed MIT. It adds 128 tokens to every session and 1,551 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to inertia-rails-testing, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

rspec-conventions

Rootstrap RSpec conventions. Use when writing, reviewing, or editing RSpec test files (spec//spec.rb, spec/railshelper.rb, spec/spechelper.rb, spec/support//.rb) or factories. Covers describe/context structure, let/subject, matchers, factories, mocking/stubbing, shared examples, and spec types (model, request…

rootstrap/rails_api_base · 82 tokens

rspec

RSpec testing best practices for Ruby and Rails applications, covering test organization, data management, and isolation patterns.

Mindrally/skills · 24 tokens

ruby

Ruby development guidelines covering idiomatic code style, Ruby 3.x features, testing with RSpec, and best practices for building maintainable Ruby applications.

Mindrally/skills · 32 tokens

testunit-skill

Generates Test::Unit tests in Ruby. Classic xUnit-style testing with assert methods and test case classes. Use when user mentions "Test::Unit", "assertequal Ruby", "Ruby test-unit". Triggers on: "Test::Unit", "Ruby test-unit", "assertequal Ruby" (not RSpec).

LambdaTest/agent-skills · 70 tokens

rspec

This skill should be used when the user asks to "write specs", "create spec", "add RSpec tests", "fix failing spec", or mentions RSpec, describe blocks, it blocks, expect syntax, test doubles, or matchers. Should also be used when editing spec.rb files, working in spec/ directory, planning implementation phases that…

hoblin/claude-ruby-marketplace · 125 tokens

rails-testing

Ruby on Rails testing best practices for writing effective, maintainable test suites with RSpec. This skill should be used when writing, reviewing, or refactoring Rails tests to ensure proper test design, data management, and coverage patterns. Triggers on tasks involving RSpec specs, model tests, request specs…

pproenca/dot-skills · 103 tokens