Randy Schmidt on 13 Sep 2007 19:46:38 -0000 |
> Just as it is frowned upon to rspec > whether ActiveRecord can save a record, I think it's equally pointless > to rspec whether validates_length_of can return an error. I'm just an observer in this conversation, but I think it is pointless to test that it can throw an error but I don't think it's pointless to test whether or not that validation is in your code. Yes, they are already tested within active record, but nothing is testing the fact that they are in your code, or the parameters you give them. For instance, I think it would not be pointless (would be pointful?) to make sure the correct range is present with validates_length_of or that the regexp in validates_format_of is doing what you want it to do. But yeah, testing those bits is less of a priority than testing the tricky bits and business logic. -- Randy Schmidt randy@umlatte.com www.umlatte.com 267.334.6833 _______________________________________________ To unsubscribe or change your settings, visit: http://lists.phillyonrails.org/mailman/listinfo/talk
|
|