How to ignore Bullet in RSpec tests
The Bullet gem is an excellent tool for finding opportunities to improve how you grab data via ActiveRecord. On a recent project, we’ve been running Bullet in our test environment as well as development. It has helped us find some improvements to areas of the app we rarely hit when developing new features.
Occasionally Bullet will shout about a potential N+1 query that, for any number of reasons you know to be false. Most commonly for us, it is that the minimal test data used doesn’t reflect what happens in the system.