foca/factory_bot — explained in plain English
Analysis updated 2026-08-08 · repo last pushed 2022-06-28
Define factories for customers, products, and orders to test e-commerce checkout flows without repetitive setup code.
Create separate factories for regular users and admin users to test role-based access logic.
Generate stubbed objects that pretend to exist so you can test code in isolation without touching the database.
Use FactoryTrace to find and remove unused factories and traits to keep your test suite clean.
| foca/factory_bot | 000madz000/rfid-attendance | 00kaku/gallery-slider-block | |
|---|---|---|---|
| Language | — | TypeScript | JavaScript |
| Last pushed | 2022-06-28 | 2024-07-22 | 2021-05-19 |
| Maintenance | Dormant | Dormant | Dormant |
| Setup difficulty | moderate | easy | easy |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | developer | general |
Figures from each repo's GitHub metadata at analysis time.
Requires a Ruby application with an existing test framework and optionally Rails for the companion integration gem.
factory_bot is a tool for Ruby developers who need realistic test data when writing automated tests for their applications. Instead of manually creating sample users, orders, or other records every time you run a test, it lets you define reusable templates, called "factories", that generate that data automatically. Think of it as a way to set up convincing placeholder information so you can verify your code works without hand-crafting the same test data over and over. At its core, it works through a straightforward definition syntax where you describe what a typical object looks like. When a test runs, it asks for an instance, and the factory assembles it based on that template. It supports multiple build strategies, you can create fully saved database records, unsaved in-memory instances, plain attribute hashes, or stubbed objects that just pretend to exist. You can also define several factories for the same class, like having one factory for a regular user and another for an admin user, with inheritance to share common traits between them. This is aimed at developers and teams working on Ruby applications, especially those using Rails, who want their test suites to be maintainable and readable. For example, an e-commerce team might define factories for customers, products, and orders, then mix and match them to test checkout flows, discount logic, or inventory updates without writing repetitive setup code in every test file. The project has been around since 2008, originally created by Joe Ferris and maintained by the consultancy thoughtbot. It is a well-established part of the Ruby testing ecosystem. The README is fairly minimal, directing readers to separate documentation for getting started, but it does mention a companion project specifically for Rails integration and a community tool called FactoryTrace that helps identify unused factories and traits to keep your test suite clean.
factory_bot is a Ruby library that lets developers define reusable templates for generating realistic test data, so you don't have to manually create sample records every time you run a test.
Dormant — no commits in 2+ years (last push 2022-06-28).
No license information provided in the explanation.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.