factory_bot

A library for setting up Ruby objects as test data. (by thoughtbot)

Factory_bot Alternatives

Similar projects and alternatives to factory_bot

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better factory_bot alternative or higher similarity.

factory_bot reviews and mentions

Posts with mentions or reviews of factory_bot. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-09-05.
  • Efate Test Generator Series: Extending the library
    2 projects | dev.to | 5 Sep 2022
    Efate is actually the second test fixture library I've written and there were several lessons I learned after using the first iteration for several years myself. The first version was influenced a great deal by factor_girl (called factory_bot now), with a heavy dependency on strings to define and create the fixtures. It also wasn't very modular. You couldn't just import a specific fixture, you had to bring in the whole library. And it wasn't very extensible, if you needed to define custom behavior for how a field should be created, it wasn't very pretty.
  • Get help from thoughtbot for free (mentoring / office hours)
    4 projects | reddit.com/r/ruby | 7 Jul 2022
    I work at thoughtbot, you might know us for our open source work like administrate, factory_bot or shoulda-matchers.
  • Gnarly Learnings From June 2022
    2 projects | dev.to | 22 Jun 2022
    As we continue to level-up our skillsets as developers in Rails, the utility of POROs (Plain Old Ruby Objects) becomes more apparent and appealing. Sometimes, the business object(s) you create do not require persistent storage to a database and are, therefore, outside of the scope of an ORM (Object Relational Mapper) like ActiveRecord. But how do we maintain simplicity in our test suite and continue to leverage helpful testing libraries like FactoryBot without one? This instructional article explores how to implement factories for POROs including common pitfalls, building nested resources, and factory linting.
  • Test Data Factories in Javascript
    4 projects | dev.to | 14 May 2022
    In the ruby world I'm a fan of factory_bot for generating objects that will serve as test data in my unit tests. I had a bit of time to kill this evening and thought it would be fun to implement the subset of the functionality that I use in factory_bot in javascript to see how I would approach it.
  • `method_missing': undefined method `has_paper_trail'
    2 projects | reddit.com/r/ruby | 18 Mar 2022
    [email protected]:~/galaxy$ rails s [DEPRECATED] Bootsnap's `autoload_paths_cache:` option is deprecated and will be removed. If you use Zeitwerk this option is useless, and if you are still using the classic autoloader upgrading is recommended. [DEPRECATED] Bootsnap's `disable_trace:` option is deprecated and will be removed. If you use Ruby 2.5 or newer this option is useless, if not upgrading is recommended. DEPRECATION WARNING: The factory_girl gem is deprecated. Please upgrade to factory_bot. See https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md for further instructions. (called from at /home/redd/galaxy/config/application.rb:9) => Booting Puma => Rails 5.2.7 application starting in development => Run `rails server -h` for more startup options /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-5.2.7/lib/active_record/type.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-5.2.7/lib/active_record/type/adapter_specific_registry.rb:9: warning: The called method `add_modifier' is defined here /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-5.2.7/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-5.2.7/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-5.2.7/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-5.2.7/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here Exiting Traceback (most recent call last): 120: from bin/rails:3:in `' 119: from bin/rails:3:in `load' .... 8: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-5.2.7/lib/active_support/dependencies.rb:661:in `new_constants_in' 7: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-5.2.7/lib/active_support/dependencies.rb:476:in `block in load_file' 6: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load' 5: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load' 4: from /home/redd/galaxy/app/models/users/user.rb:1:in `' 3: from /home/redd/galaxy/app/models/users/user.rb:2:in `' 2: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/attr_encrypted-3.1.0/lib/attr_encrypted/adapters/active_record.rb:131:in `method_missing_with_attr_encrypted' 1: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/attr_encrypted-3.1.0/lib/attr_encrypted.rb:306:in `method_missing' /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-5.2.7/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_paper_trail' for # (NoMethodError) Did you mean? has_attached_file
  • Five Easy to Miss PostgreSQL Query Performance Bottlenecks
    4 projects | news.ycombinator.com | 18 Jan 2022
  • It really be like that though
    9 projects | reddit.com/r/ProgrammerHumor | 6 Nov 2021
    Here is an example from Factory Bot itself, which includes embedded Ruby (in this case):
  • Recommend a fixtures replacement (e.g ruby factory-bot) in Golang.
    3 projects | reddit.com/r/golang | 15 Aug 2021
    When I switch language from ruby to golang, I desired to have an alternative to factory-bot (a ruby gem). Therefore, I found the go-factory which can be used to build random object for testing. After using it for a while, I decide to build another fixtures replacement package which is gogo-factory.
  • Go Tool: (exploring) sqlc (Part 1)
    8 projects | dev.to | 15 Feb 2021
    I will continue exploring sqlc as well as the other tools/packages mentioned above, another thing I'm also investigating is something similar to factory_bot for speeding up the default values required when testing PostgreSQL-related methods.
  • LPT: There is a library called Bogus, you should know it exists much earlier than I did in my career.
    4 projects | reddit.com/r/csharp | 7 Feb 2021
    The Ruby world has FactoryBot and Faker. Nice to know something like that exists in .NET, also!
  • A note from our sponsor - Zigi
    www.zigi.ai | 9 Dec 2022
    Zigi monitors Jira and GitHub updates, pings you when PRs need approval and lets you take fast actions - all directly from Slack! Plus it reduces cycle time by up to 75%. Learn more →

Stats

Basic factory_bot repo stats
23
7,658
4.8
24 days ago
Close all those tabs. Zigi will handle your updates.
Zigi monitors Jira and GitHub updates, pings you when PRs need approval and lets you take fast actions - all directly from Slack! Plus it reduces cycle time by up to 75%.
www.zigi.ai