0.0
No commit activity in last 3 years
No release in over 3 years
Common FactoryBot utils for Jets application development
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0

Runtime

~> 2.7
~> 6.0
 Project Readme

Jets Factory

FactoryBot utilities for apps and engines.

Includes:

  • faker (with only English locale loaded)
  • ActiveSupport.on_load(:factory_bot) hook to configure factory_bot prior to loading definitions
  • factory_bot_rails (if Rails is defined)

Usage

Require it instead of factory_bot (or factory_bot_rails) and use as always:

require "jets-factory"

Active Support load hook

The load hook could be used to tell FactoryBot where to look for factory definitions:

ActiveSupport.on_load(:factory_bot) do
  FactoryBot.definition_file_paths.unshift File.join(__dir__, "../spec/factories")
end

Why a separate gem and not a part of jets-testing?

Factories could be used not only in test env, but in development and production (e.g., for DB seeds and mailers previews).