Forum: Ruby on Rails Test Associations are Preloaded

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Raymond O. (Guest)
on 2007-05-03 02:28
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 topic is locked and can not be replied to.