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