https://github.com/thoughtbot/factory_bot
A library for setting up Ruby objects as test data.
https://github.com/thoughtbot/factory_bot
Keywords
factories factory-bot factory-girl fixtures rails ruby rubygems testing thoughtbot
Keywords from Contributors
activerecord activejob mvc rspec crash-reporting rubocop sinatra static-code-analysis code-formatter sidekiq
Last synced: about 16 hours ago
JSON representation
Repository metadata
A library for setting up Ruby objects as test data.
- Host: GitHub
- URL: https://github.com/thoughtbot/factory_bot
- Owner: thoughtbot
- License: mit
- Created: 2008-06-03T13:55:37.000Z (over 17 years ago)
- Default Branch: main
- Last Pushed: 2025-11-24T02:10:57.000Z (17 days ago)
- Last Synced: 2025-12-03T23:29:01.002Z (7 days ago)
- Topics: factories, factory-bot, factory-girl, fixtures, rails, ruby, rubygems, testing, thoughtbot
- Language: Ruby
- Homepage: https://thoughtbot.com
- Size: 3.67 MB
- Stars: 8,346
- Watchers: 123
- Forks: 2,589
- Open Issues: 76
- Releases: 32
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
README.md
factory_bot
factory_bot is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.
If you want to use factory_bot with Rails, see
factory_bot_rails.
Interested in the history of the project name? You can find the history here
Transitioning from factory_girl? Check out the upgrade guide.
Documentation
See our extensive reference, guides, and cookbook in the factory_bot book.
For information on integrations with third party libraries, such as RSpec or
Rails, see the factory_bot wiki.
We also have a detailed introductory video, available for free on Upcase.
Install
Run:
bundle add factory_bot
To install the gem manually from your shell, run:
gem install factory_bot
Supported Ruby versions
Supported Ruby versions are listed in .github/workflows/build.yml (source)
More Information
Useful Tools
- FactoryTrace - helps to find unused factories and traits.
- ruby-lsp-factory_bot / ruby-lsp-rails-factory-bot - integration with ruby-lsp to provide intellisense
Contributing
Please see CONTRIBUTING.md.
factory_bot was originally written by Joe Ferris and is maintained by thoughtbot.
Many improvements and bugfixes were contributed by the open source
community.
License
factory_bot is Copyright © 2008 Joe Ferris and thoughtbot. It is free
software, and may be redistributed under the terms specified in the
LICENSE file.
About thoughtbot
This repo is maintained and funded by thoughtbot, inc.
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
We love open source software!
See our other projects.
We are available for hire.
Owner metadata
- Name: thoughtbot, inc.
- Login: thoughtbot
- Email: hello@thoughtbot.com
- Kind: organization
- Description: We work with organizations of all sizes to design, develop, and grow their web and mobile products.
- Website: https://thoughtbot.com
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/6183?v=4
- Repositories: 434
- Last ynced at: 2024-04-14T06:41:37.100Z
- Profile URL: https://github.com/thoughtbot
GitHub Events
Total
- Create event: 28
- Release event: 3
- Issues event: 36
- Watch event: 315
- Delete event: 38
- Issue comment event: 130
- Push event: 75
- Pull request review comment event: 25
- Pull request review event: 46
- Pull request event: 87
- Fork event: 18
Last Year
- Create event: 26
- Release event: 3
- Issues event: 30
- Watch event: 290
- Delete event: 38
- Issue comment event: 97
- Push event: 75
- Pull request review comment event: 25
- Pull request review event: 45
- Pull request event: 77
- Fork event: 13
Committers metadata
Last synced: 4 days ago
Total Commits: 1,293
Total Committers: 301
Avg Commits per committer: 4.296
Development Distribution Score (DDS): 0.663
Commits in past year: 56
Committers in past year: 21
Avg Commits per committer in past year: 2.667
Development Distribution Score (DDS) in past year: 0.768
| Name | Commits | |
|---|---|---|
| Joshua Clayton | j****n@t****m | 436 |
| Daniel Colson | d****n@g****m | 138 |
| Joe Ferris | j****s@t****m | 138 |
| Mike Burns | m****s@t****m | 22 |
| eugenebolshakov | e****v@g****m | 17 |
| Gabe Berke-Williams | g****e@t****m | 15 |
| Yudai Takada | t****2@g****m | 14 |
| Richie Thomas | r****e@t****m | 13 |
| Thomas Walpole | t****e@g****m | 13 |
| CodeMeister | b****b@k****m | 13 |
| Oliver Peate | o****p@g****m | 10 |
| Oli Peate | o****i@t****m | 9 |
| Neil Carvalho | me@n****o | 9 |
| Valerie Burzynski | v****i@t****m | 9 |
| Joe Ferris | j****s@m****l | 8 |
| Alejandro Dustet | a****t@g****m | 8 |
| Nick Quaranto | n****k@q****o | 7 |
| Jon Yurek | j****k@t****m | 6 |
| Ben Orenstein | b****n@g****m | 6 |
| Dan Croak | d****k@t****m | 6 |
| Earlopain | 1****n | 6 |
| Josh Nichols | j****h@t****m | 6 |
| Matt Jankowski | m****i@t****m | 6 |
| Simone Carletti | w****s@w****t | 6 |
| Stefanni Brasil | s****l@g****m | 6 |
| Kristian Mandrup | k****p@g****m | 5 |
| Nick Quaranto | n****k@t****m | 5 |
| Tristan Dunn | t****n@g****m | 5 |
| Chad Pytel | c****l@t****m | 5 |
| Sarah Lima | s****d@g****m | 4 |
| and 271 more... | ||
Committer domains:
- thoughtbot.com: 30
- me.com: 2
- yandex.ru: 2
- github.com: 2
- fixedpoint.xyz: 1
- sevenwire.com: 1
- blueapron.com: 1
- angilly.com: 1
- opensoul.org: 1
- bswtechconsulting.com: 1
- chrishunt.co: 1
- ctoomey.com: 1
- esler.co.nz: 1
- dio.jp: 1
- ndpsoftware.com: 1
- wi.mit.edu: 1
- benjaminfleischer.com: 1
- lawgives.org: 1
- joshsoftware.com: 1
- aspgems.com: 1
- juntostudio.com: 1
- mdlogix.com: 1
- we-b.co.jp: 1
- itransition.com: 1
- outreach.io: 1
- highcode.dk: 1
- scvngr.com: 1
- reframeit.com: 1
- katanacode.com: 1
- neil.pro: 1
- quaran.to: 1
- technicalpickles.com: 1
- weppos.net: 1
- tysongach.com: 1
- cardflight.com: 1
- drapergeek.com: 1
- jaredbeck.com: 1
- instihost.com: 1
- suse.com: 1
- sikachu.com: 1
- wegowise.com: 1
- winningham.net: 1
- olivierlacan.com: 1
- ualberta.ca: 1
- launchware.com: 1
- expectedbehavior.com: 1
- matijs.net: 1
- thatch.ai: 1
- credible.com: 1
- oboxodo.com: 1
- echographia.com: 1
- f0x.io: 1
- ping.de: 1
- nyh.se: 1
- indeo.us: 1
- acm.org: 1
- ianduggan.net: 1
- o2.pl: 1
- beezwax.net: 1
- columbia.edu: 1
- debian.org: 1
- zendesk.com: 1
- codeforamerica.org: 1
- dedasys.com: 1
- schito.me: 1
- iki.fi: 1
- mattbrictson.com: 1
- matthewhiggins.com: 1
- pobox.com: 1
- mikeshop.net: 1
- nickcharlton.net: 1
- snap2web.com: 1
- posteo.de: 1
- spacebabies.nl: 1
- suse.de: 1
- karmi.cz: 1
- metaskills.net: 1
- fearoffish.com: 1
- thorn.co: 1
- vibes.com: 1
- 6spot.com.br: 1
- novell.com: 1
- gun.io: 1
- iblargz.com: 1
- mcgeary.org: 1
- salimane.com: 1
- cyt.ch: 1
- rougecardinal.fr: 1
- red56.co.uk: 1
- shopify.com: 1
- redhat.com: 1
- suschlik.de: 1
- petteriraty.eu: 1
- phlippers.net: 1
- u2622.ca: 1
- obsess.com: 1
- familiekranz.de: 1
- tutormentor.org: 1
- feistmantl.io: 1
- urbanautomaton.com: 1
- gotocandid.com: 1
- captaincontrat.com: 1
- aquachan.de: 1
- krautcomputing.com: 1
Issue and Pull Request metadata
Last synced: 8 days ago
Total issues: 133
Total pull requests: 274
Average time to close issues: 5 months
Average time to close pull requests: 3 months
Total issue authors: 120
Total pull request authors: 80
Average comments per issue: 3.1
Average comments per pull request: 1.19
Merged pull request: 145
Bot issues: 0
Bot pull requests: 37
Past year issues: 17
Past year pull requests: 78
Past year average time to close issues: 8 days
Past year average time to close pull requests: 6 days
Past year issue authors: 17
Past year pull request authors: 18
Past year average comments per issue: 1.53
Past year average comments per pull request: 0.59
Past year merged pull request: 55
Past year bot issues: 0
Past year bot pull requests: 6
Top Issue Authors
- mike-burns (8)
- composerinteralia (5)
- grekko (2)
- jasonkarns (2)
- eszancheUez (1)
- slhck (1)
- Talha345 (1)
- mikebaldry (1)
- frenkel (1)
- swelther (1)
- neilvcarvalho (1)
- smaboshe (1)
- MarcusRiemer (1)
- Set27 (1)
- masarakki (1)
Top Pull Request Authors
- dependabot[bot] (27)
- CodeMeister (25)
- neilvcarvalho (18)
- ydah (13)
- sarahraqueld (12)
- smaboshe (11)
- vburzynski (10)
- github-actions[bot] (10)
- mike-burns (8)
- Earlopain (8)
- stefannibrasil (7)
- composerinteralia (6)
- seanpdoyle (5)
- mohammednasser-32 (4)
- grekko (4)
Top Issue Labels
- bug (54)
- feature (46)
- attached PR (3)
- documentation (2)
- pending-response (1)
- 7.0 Release (1)
- good first issue (1)
- stale (1)
Top Pull Request Labels
- dependencies (27)
- ruby (24)
- documentation (6)
- github_actions (3)
- bug (2)
- 7.0 Release (2)
- open summit (2)
Package metadata
- Total packages: 3
-
Total downloads:
- rubygems: 608,753,012 total
- Total docker downloads: 1,197,214,746
- Total dependent packages: 520 (may contain duplicates)
- Total dependent repositories: 58,194 (may contain duplicates)
- Total versions: 159
- Total maintainers: 4
gem.coop: factory_bot
factory_bot provides a framework and DSL for defining and using factories - less error-prone, more explicit, and all-around easier to work with than fixtures.
- Homepage: https://github.com/thoughtbot/factory_bot
- Documentation: http://www.rubydoc.info/gems/factory_bot/
- Licenses: MIT
- Latest release: 6.5.6 (published about 2 months ago)
- Last Synced: 2025-12-06T23:01:41.805Z (4 days ago)
- Versions: 36
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 304,392,419 Total
- Docker Downloads: 598,607,373
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.058%
- Downloads: 0.078%
- Docker downloads count: 0.152%
- Maintainers (4)
rubygems.org: factory_bot
factory_bot provides a framework and DSL for defining and using factories - less error-prone, more explicit, and all-around easier to work with than fixtures.
- Homepage: https://github.com/thoughtbot/factory_bot
- Documentation: http://www.rubydoc.info/gems/factory_bot/
- Licenses: MIT
- Latest release: 6.5.6 (published about 2 months ago)
- Last Synced: 2025-12-06T02:20:49.161Z (5 days ago)
- Versions: 36
- Dependent Packages: 520
- Dependent Repositories: 58,193
- Downloads: 304,360,593 Total
- Docker Downloads: 598,607,373
-
Rankings:
- Downloads: 0.085%
- Dependent packages count: 0.09%
- Forks count: 0.11%
- Average: 0.128%
- Dependent repos count: 0.145%
- Stargazers count: 0.147%
- Docker downloads count: 0.193%
- Maintainers (4)
proxy.golang.org: github.com/thoughtbot/factory_bot
- Homepage:
- Documentation: https://pkg.go.dev/github.com/thoughtbot/factory_bot#section-documentation
- Licenses: mit
- Latest release: v6.5.6+incompatible (published about 2 months ago)
- Last Synced: 2025-12-06T02:20:50.700Z (5 days ago)
- Versions: 87
- Dependent Packages: 0
- Dependent Repositories: 1
-
Rankings:
- Forks count: 0.131%
- Stargazers count: 0.742%
- Average: 3.53%
- Dependent repos count: 4.79%
- Dependent packages count: 8.456%
Dependencies
- activerecord-jdbcsqlite3-adapter >= 0
- sqlite3 >= 0
- activemodel 6.1.3
- activerecord 6.1.3
- activesupport 6.1.3
- appraisal 2.3.0
- aruba 1.0.4
- ast 2.4.2
- builder 3.2.4
- childprocess 4.0.0
- concurrent-ruby 1.1.8
- contracts 0.16.0
- cucumber 5.3.0
- cucumber-core 8.0.1
- cucumber-create-meta 2.0.4
- cucumber-cucumber-expressions 10.3.0
- cucumber-gherkin 15.0.2
- cucumber-html-formatter 9.0.0
- cucumber-messages 13.2.1
- cucumber-tag-expressions 2.0.4
- cucumber-wire 4.0.1
- diff-lcs 1.4.4
- docile 1.3.5
- factory_bot 6.2.1
- ffi 1.14.2
- i18n 1.8.9
- middleware 0.1.0
- minitest 5.14.3
- multi_test 0.1.2
- parallel 1.21.0
- parser 3.1.0.0
- protobuf-cucumber 3.10.8
- rainbow 3.1.1
- rake 13.0.3
- regexp_parser 2.2.0
- rexml 3.2.5
- rspec 3.10.0
- rspec-core 3.10.1
- rspec-expectations 3.10.1
- rspec-its 1.3.0
- rspec-mocks 3.10.2
- rspec-support 3.10.2
- rubocop 1.24.1
- rubocop-ast 1.15.1
- rubocop-performance 1.13.1
- ruby-progressbar 1.11.0
- simplecov 0.21.2
- simplecov-html 0.12.3
- simplecov_json_formatter 0.1.2
- sqlite3 1.4.2
- standard 1.6.0
- sys-uname 1.2.2
- thor 1.1.0
- thread_safe 0.3.6
- tzinfo 2.0.4
- unicode-display_width 2.1.0
- yard 0.9.26
- zeitwerk 2.4.2
- activerecord >= 0 development
- appraisal >= 0 development
- aruba >= 0 development
- cucumber >= 0 development
- rake >= 0 development
- rspec >= 0 development
- rspec-its >= 0 development
- simplecov >= 0 development
- standard >= 0 development
- yard >= 0 development
- activesupport >= 5.0.0
- actions/checkout v2 composite
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3 composite
Score: 36.06010849752033