rails-test-writer

Generate RSpec or Minitest tests for Ruby on Rails classes.

Updated Dec 8, 2022
One-click install
npx skills add https://github.com/lekemula/dotfiles --skill rails-test-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-test-writer
Source: https://github.com/lekemula/dotfiles/tree/main/claude/skills/rails-test-writer
Command: npx skills add https://github.com/lekemula/dotfiles --skill rails-test-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the generation of comprehensive unit and integration tests for Ruby on Rails applications, ensuring code quality and maintainability.

Core Features & Use Cases

  • Automated Test Generation: Creates RSpec or Minitest tests for Rails models, controllers, and service objects.
  • Framework Detection: Automatically identifies the testing framework used in the project.
  • Style Convention Adherence: Analyzes existing tests to maintain consistent coding style.
  • Use Case: When developing a new feature in a Rails app, use this Skill to quickly generate a full suite of tests for your new model, covering happy paths, edge cases, and validations.

Quick Start

Generate RSpec tests for the user model located at app/models/user.rb.

Frequently Asked Questions about rails-test-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate RSpec tests for a Rails model automatically?

Automated Rails test generation analyzes existing test suites to match style conventions, then creates RSpec or Minitest tests covering happy paths, edge cases, error handling, and validations for models, controllers, and service objects.

Does this testing tool support both RSpec and Minitest?

Yes, the tool supports both RSpec and Minitest frameworks. It automatically detects the testing framework used in your existing project test suite to generate matching tests.

Can I generate Rails controller tests that handle authorization and parameter handling?

Yes, Rails controller test generation includes coverage for authorization, parameter handling, error handling, and edge cases alongside standard happy paths, ensuring comprehensive integration tests for your controllers.

What is the best way to ensure generated Rails tests match my project's existing style?

Ensure generated tests match your project's style by analyzing existing project test suites for conventions before generation. This tool automatically detects and mirrors your current testing patterns and factory usage.

How do I write tests for Rails service objects covering edge cases?

Write tests for Rails service objects by automating generation of unit tests that cover edge cases, error handling, and happy paths. The tool analyzes existing conventions and supports factory usage for test data.