ruby
ruby
ruby
How to create multi trait inside trait in FactoryBot
FactoryBot traits can nest other traits, letting you compose reusable test fixtures instead of copying attribute blocks. A quick refresher on traits, then the traitception pattern: defining traits inside traits and combining them for cleaner Rails test setup.
minitest
Finding the slowest tests in Minitest and Rspec using profiler
Slow test suites usually hide a few expensive tests. Minitest and RSpec both ship a built-in profiler: bin/rails test --profile and rspec --profile 10 list your slowest examples with execution times, so you know exactly which tests to optimize first.