using Bullet gem for testing with rspec

Viewed 3742

I am using rspec or testing API's. simultaneously I am using bullet gem for identifying N+1 query problem.

Bullet gem works fine in all other environments except test(rspec)

Bullet gem indicates

Bullet::Notification::UnoptimizedQueryError: user: karthik
Unused Eager Loading detected

and stops the test process to run.

If I remove the corresponding eager loading it works fine, but in development's server log

user: karthik
/api/v1/grades
N+1 Query detected
  Grade => [:grade_details]
  Add to your finder: :includes => [:grade_details]
N+1 Query method call stack

and also I referred https://github.com/flyerhzm/bullet/issues/115 but there also I couldn't get a straight forward answer

1 Answers
Related