Write Action Spec

Use when writing isolated RSpec unit specs for Hanami 2.x Actions — place spec under `spec/actions/` mirroring the action namespace with `type: :action` metadata, stub all `Deps[...]` dependencies via `instance_double` passed to `described_class.new(dep: stub)`, test both success (200/201) and error (422/500) paths, assert on `response.status`, `response.headers`, and action exposures without hitting the database or HTTP stack, and confirm the spec fails before implementing the Action. Generates specs with test doubles, status assertions, and params validation tests.

igmarin 5d2cc58 3.8 KB Updated

File contents

igmarin/hanakai-yaku/tree/main/skills/testing/write-action-spec commit 5d2cc58aa8

Frequently asked questions

npx skillmds@latest add igmarin/write-action-spec