Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Taryn East's Profile

GitHub User: taryneast

Site: http://rubyglasses.blogspot.com/

Comments by Taryn East

Avatar

How would I build tests for the "find_products" method?

Avatar

later versions of rails do not perform the search until you actually use the results. So every one of the calls in the code just builds a set of conditions.

it will not hit the database until you use "all" or "each" on "products"