Matt Wynne wrote:

I've got a reason. You're coupling the tests for this simple little controller class to all the infrastructure and dependencies needed to write the record to the database and reload it again. As easy as Rails makes it for us to manage our database schemas, gratuitously introducing dependencies in your code like this is a bad habit to get into. It can lead to tests that are fragile to failing when code is changed far away from the place they're apparently testing. The tests also run slowly, which makes working on systems written like this boring.

The point of unit tests (which include the alleged "functional tests" in Rails) is to fail more often than production code would fail. Not less often.

--
  Phlip
  http://flea.sourceforge.net/resume.html

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

Reply via email to