On 15 Apr 2009, at 15:30, Phlip wrote:

Fernando Perez wrote:

I was refactoring my model specs so that they don't hit the database,
but how to handle a custom find that uses :joins or :include with some
important :conditions? I can't see a way to not hit the database.

What's wrong with hitting the database?

When high-end consultants like Mike Feathers tell you not to hit the database, what they are really saying is that programmers using big iron languages like C++ or Java should start decoupling by any means necessary. It's just a mind-game.

At the other extreme, systems like Rails and its test fixtures have illustrated how you can leverage the database for a pool of stub objects. It doesn't lead to bad design, or slow tests down.

It doesn't slow tests down!? Are you sure?


Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to