Test Associations are Preloaded

What’s the best way to test that all assocaitions are preloaded when a
method is called?

For example, do_something is a method that makes a db call and preloads
several associations. Is there a way to write a test that checks that
calls to do_something only make one db call?

On the functional level is there a way to write tests that check that
actions only trigger a certain number of db queries (counting only loads
and not the select column queries).

Cheers, Ray

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs