thoughtbot/factory_bot

A library for setting up Ruby objects as test data.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 51 minutes ago
Added to GitGenius on September 8th, 2026
Created on June 3rd, 2008
Open Issues & Pull Requests: 81 (+0)
GitHub issues: Enabled
Number of forks: 2,555
Total Stargazers: 8,170 (+0)
Total Subscribers: 122 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 6.8 days
Mean response time: 83.3 days
90th percentile: 204.1 days
Tracked items: 55

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 96% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Only 2% of issues opened in the past year have been closed. Three people close 78% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 24
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 722 days
Stale 30+ days: 22
Stale 90+ days: 20

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (21)
  • feature (18)
  • good first issue (5)
  • documentation (3)
  • attached PR (1)
  • help wanted (1)
  • stale (1)
  • with reproduction steps (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

factory_bot is a fixtures replacement library for Ruby that provides a straightforward syntax for defining test data with support for multiple build strategies and factory inheritance.

The library solves the problem of managing test data by replacing traditional fixtures with a more flexible approach. Instead of maintaining static fixture files, developers define factories using a simple DSL that can generate objects in different ways: as saved database instances, unsaved instances, attribute hashes, or stubbed objects. The tool supports creating multiple factories for the same class, such as separate user and admin_user factories, and allows factories to inherit from one another to reduce duplication.

Developers building Rails applications should use the factory_bot_rails integration gem. The tool suits any Ruby project that needs to generate test objects, particularly those already using Rails or RSpec. The README positions factory_bot as a replacement for fixtures, offering greater flexibility and maintainability for test data management. Extensive documentation is available through the factory_bot book, a wiki covering third-party integrations, and introductory video content.

The project maintains active engagement with its community through a well-organized contribution process documented in its CONTRIBUTING file. The tool provides clear upgrade guidance for users transitioning from earlier versions. The project benefits from ecosystem tooling built by the community, including utilities for identifying unused factories and IDE integrations that provide intellisense support within development environments.