FactoryGirl::Benchmark
benchmark your top-level factory_girl factories
Installation
gem 'factory_girl-benchmark', require: false
Usage
Here's an example of how we use it in our test helper:
if ENV['FG_BENCH']
require 'factory_girl/benchmark'
FactoryGirl.singleton_class.prepend(FactoryGirl::Benchmark)
# Register before minitest to have minitest run first
at_exit { FactoryGirl::Benchmark.report }
end
You could also use the example which will run all of your factories:
FactoryGirl::Benchmark.benchmark!