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. 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. Each factory has a name and a set of attributes. The name is used to guess the class of the object by default. It is recommended that you have one factory for each class that provides the simplest set of attributes necessary to create an instance of that class. If you're creating ActiveRecord objects, that means that you should only provide attributes that are required through validations and that do not have defaults. Other factories can be created through inheritance to cover common scenarios for each class.

Features

  • Build or create multiple records
  • Custom methods to persist objects
  • ActiveSupport instrumentation
  • Rails preloaders and RSpec
  • Use without a bundler
  • Modify factories

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow factory_bot

factory_bot Web Site

You Might Also Like
Employee monitoring software with screenshots Icon
Employee monitoring software with screenshots

Clear visibility and insights into how employees work. Even remotely

Our computer monitoring software allows employees, field contractors, and freelancers to manually clock in when they begin working on an assignment. The application will take screenshots randomly or at set intervals, which allows employers to observe the work process. The application only tracks activity when the employee is clocked in. No spying, only transparency.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of factory_bot!

Additional Project Details

Programming Language

Ruby

Related Categories

Ruby Software Testing Tool, Ruby Libraries

Registered

2021-07-30