On Wed, Feb 18, 2009 at 11:42 PM, Yi Wen <hayafi...@gmail.com> wrote: > > Without this syntax sugar, we still have to test validates_presence_of to > make sure it's there and won't broken, right?
Wrong. You don't have to test validates_presence_of. What matters, and therefore what you should test, is whether the model will complain at you if a particular value is left empty. validates_presence_of happens to be the name of the method in ActiveRecord that does that. But if you decide to write your own check_to_see_if_this_thingy_is_in_my_whatsis() method that does the same thing, a good *behavior* spec will not break. Because the behavior remains the same. If your spec breaks because you changed a method call, you're not testing behavior any more. You're testing syntax. -- Have Fun, Steve Eley (sfe...@gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users