rails-tdd

Implement test-driven development workflows for Ruby on Rails with RSpec, FactoryBot, and Capybara.

5|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/FaisalAlqarni/sp-ecc --skill rails-tdd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-tdd
Source: https://github.com/FaisalAlqarni/sp-ecc/tree/main/skills/rails-tdd
Command: npx skills add https://github.com/FaisalAlqarni/sp-ecc --skill rails-tdd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of building reliable Ruby on Rails applications by enforcing a rigorous test-driven development (TDD) workflow, ensuring code quality and maintainability.

Core Features & Use Cases

  • Comprehensive Testing: Covers models, controllers, requests, and system-level interactions with RSpec, FactoryBot, and Capybara.
  • TDD Workflow Guidance: Provides clear examples and principles for the Red-Green-Refactor cycle.
  • Use Case: When developing a new API endpoint in a Rails application, use this Skill to define failing tests for the request and controller, implement the minimal code to pass, and then refactor, ensuring the endpoint is robust and well-tested.

Quick Start

Activate the rails-tdd skill to generate a new RSpec test for a Rails model.

Frequently Asked Questions about rails-tdd

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

FAQPage Schema
How do I implement test-driven development in a Ruby on Rails application?

Test-driven development in Rails involves writing failing tests first using RSpec, implementing minimal code to pass them, and refactoring. This Skill guides you through the Red-Green-Refactor cycle for models, controllers, requests, and system tests.

What's the best way to structure RSpec tests for Rails models and controllers?

The best way to structure RSpec tests is by separating model, controller, request, and system specifications. This Skill provides detailed examples of test structure and best practices for achieving high test coverage using RSpec and FactoryBot.

Can I use Capybara with RSpec for Rails system testing?

Yes, you can use Capybara with RSpec for Rails system testing. This Skill supports comprehensive system-level interaction testing, allowing you to simulate user interactions and verify end-to-end application behavior alongside model and request tests.

How does FactoryBot work with Rails TDD workflows?

FactoryBot works within Rails TDD workflows by generating test data objects for your RSpec tests. This Skill integrates FactoryBot to help you define and create test records, ensuring your models, controllers, and system tests have consistent and reliable data.

When do I need to write request tests versus controller tests in Rails?

You need request tests to verify HTTP endpoints and responses, while controller tests check internal logic. This Skill covers both, providing TDD workflow guidance and examples to help you decide when to use each for high test coverage.

Why does test-driven development improve Ruby on Rails applications?

Test-driven development improves Rails applications by enforcing a rigorous workflow that ensures code quality and maintainability. By writing tests first with RSpec, you build robust applications with high test coverage and fewer regressions.