1.1.0
Highlights
- Added Factory Default (or factory associations) profiler and FactoryDefault usage stats.
Factory Default profiles shows which factories (and variations) were created via associations and how many times. This information can help you estimate the effect of adding a default record.
Here is an example report:
$ FACTORY_DEFAULT_PROF=1 bin/rspec
[TEST PROF INFO] Factory associations usage:
factory count total time
track 281 00:12.671
user{organization:<Organization#<id>>} 62 00:05.830
user 46 00:04.401
assessment 6 00:02.599
specialist_vertical 24 00:02.209
user[without_plan] 16 00:01.201
organization 352 00:01.138
admin 341 00:00.999
After adding default factory records, you can now also get the information about the actual usage:
$ FACTORY_DEFAULT_STATS=1 bin/rspec spec/models/user_spec.rb
[TEST PROF INFO] FactoryDefault usage stats:
factory hit miss
track 224 51
admin 83 0
organization 77 89
user 51 82
FactoryDefault summary: hit=435 miss=222