A Rails app's test suite takes 45 minutes to run. The biggest cost is database setup per test. Which strategy best reduces this?
-
A
Switch from RSpec to Minitest for faster execution
-
B
Use database_cleaner with transaction strategy instead of truncation
-
C
Mock all ActiveRecord models to avoid hitting the database
-
D
Shard tests across multiple CI workers in parallel