$npx skillfedfor your agent

inertia-rails-testing

Test Inertia Rails controller actions with RSpec matchers that verify rendered components, props, flash messages, and deferred data. Always use matchers like `render_component` and `have_props` instead of direct property access, and remember to call `follow_redirect!` after POST/PATCH/DELETE before asserting flash or props.

inertia-rails-testing provides RSpec matchers to verify Inertia component renders, props, and flash messages in controller specs.

AI-generated summary based on this skill's SKILL.md

64 1 MITupdated by inertia-rails

Decision gist · record as of 2026-02-13

inertia-rails-testing provides RSpec matchers to verify Inertia component renders, props, and flash messages in controller specs. Test Inertia Rails controller actions with RSpec matchers that verify rendered components, props, flash messages, and deferred data. Always use matchers like `render_component` and `have_props` instead of direct property access, and remember to call `follow_redirect!` after POST/PATCH/DELETE before asserting flash or props.

manual: git clone https://github.com/inertia-rails/skills → cp -r skills/skills/inertia-rails-testing ~/.claude/skills/inertia-rails-testing
skills/inertia-rails-testing/SKILL.md · version 2846b368

Use it when

  • inertia-rails-testing provides matchers like `render_component`, `have_props`, and `have_flash` for request specs.
  • inertia-rails-testing requires calling `follow_redirect!` after POST, PATCH, or DELETE requests before asserting props or flash.

Verify before relying

Read SKILL.md below before installing (2 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

inertia-rails/skills/inertia-rails-testing

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I test Inertia Rails components with RSpec matchers?

inertia-rails-testing uses RSpec matchers to verify Inertia responses. Use `render_component` to assert which component was rendered, `have_props` to check passed props, and `have_flash` for flash messages. Always prefer matchers over direct property access: `expect(response).to render_component('Users/Index').with_props(count: 42)` instead of manually inspecting response data.

What's the correct way to test RSpec matchers for Inertia responses?

inertia-rails-testing provides matchers like `render_component`, `have_props`, and `have_flash` for request specs. Chain them to verify component name, passed props, and flash messages in a single assertion. Example: `expect(response).to render_component('Dashboard').with_props(user: @user).and_have_flash('success', 'Saved')`. These matchers replace manual JSON inspection.

How do I handle POST/PATCH/DELETE redirects in Inertia testing?

inertia-rails-testing requires calling `follow_redirect!` after POST, PATCH, or DELETE requests before asserting props or flash. The mutation endpoints redirect to a GET page; without following, you'll inspect the redirect response, not the target page. Example: `post '/users', params: {...}; follow_redirect!; expect(response).to have_flash('success')`.

How can I test deferred props and partial reload behavior?

inertia-rails-testing supports testing deferred props by verifying they appear in the response with lazy-load metadata. Use matchers to inspect the props structure and confirm deferred keys are present. For partial reloads, pass the `X-Inertia-Partial-Data` header in your request spec to simulate client-side partial updates, then assert only the specified props are returned.

What are the key testing patterns for Inertia Rails controller actions?

inertia-rails-testing establishes patterns: use `render_component` to verify the rendered component name, chain `with_props` to assert prop values, call `follow_redirect!` after mutations, and use `have_flash` for flash assertions. Avoid accessing response JSON directly; matchers provide clearer, more maintainable specs that document intent and catch regressions.

Can I convert RSpec patterns to Minitest for Inertia testing?

inertia-rails-testing is primarily RSpec-focused, but Minitest users can write custom assertions or use gems that bridge RSpec matchers. The core patterns—verifying component names, props, and flash—remain the same; only the assertion syntax changes. Consider using `assert_equal` on parsed response JSON or adopting RSpec alongside Minitest for integration tests.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

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

(truncated - see the full file via the links below)

File tree — 2 files
skills/inertia-rails-testing/SKILL.md
skills/inertia-rails-testing/references/minitest.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Write RSpec tests for Inertia Rails controller actions using matchers”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

inertia-rails-controllers
by inertia-rails · inertia-rails/skills

Master server-side Inertia patterns in Rails controllers. Learn when to use render inertia with explicit props, how to defer expensive queries, share data across pages, and handle validation errors correctly. Covers prop types, flash messages, and the critical inertia_location rule for external redirects.

MITupdated Feb 2026
★ 64repo stars
Inertia Coder
by majesticlabs-dev · majesticlabs-dev/majestic-marketplace

Inertia Coder guides you through building modern single-page applications that combine Inertia.js with Rails and your choice of React, Vue, or Svelte. It covers controller setup, page component patterns, form handling with the useForm hook, shared data management, and client-side routing—all without the complexity of separate APIs.

no license declared → metadata onlyupdated May 2026
★ 44repo stars
Rspec Coder
by majesticlabs-dev · majesticlabs-dev/majestic-marketplace

Rspec Coder streamlines Ruby testing by automatically generating RSpec test files and cases tailored to your codebase. Skip manual test scaffolding and focus on test logic while the skill handles boilerplate creation and structure.

no license declared → metadata onlyupdated May 2026
★ 44repo stars
inertia-rails-architecture
by inertia-rails · inertia-rails/skills

Master the server-driven mental model behind Inertia Rails: the server owns routing, data, and auth while React renders UI only. This skill routes you to the right pattern for pages, forms, navigation, and data refresh through a decision matrix covering data sources, state ownership, and common anti-patterns to avoid.

MITupdated Feb 2026
★ 64repo stars
inertia-rails-pages
by inertia-rails · inertia-rails/skills

Inertia Rails Pages provides patterns for constructing pages that maintain layout state across navigation, derive UI from URL parameters server-side, and use client-side router methods to update props without full reloads. It covers persistent layouts, prefetching, partial data refresh, and deferred component rendering across React, Vue, and Svelte.

MITupdated Feb 2026
★ 64repo stars
capybara-skill
by LambdaTest · LambdaTest/agent-skills

This skill enables you to automatically generate Capybara acceptance tests for web applications, streamlining your test automation workflow. Built by LambdaTest (now TestMu AI), it simplifies the process of creating robust browser-based test scenarios without manual coding overhead.

MITupdated Jul 2026
★ 339repo stars

More skills alba-inertia (MIT) · inertia-rails-typescript (MIT)

Tags
rspec-matchersrequest-specsprop-validationflash-testingredirect-handlingdeferred-loadingintegration-testingminitest-equivform-submission-tests