[rspec-users] validate_presence_of

Zach Dennis zach.dennis at gmail.com
Wed Feb 18 21:06:42 EST 2009

On Wed, Feb 18, 2009 at 7:39 PM, Fernando Perez <lists at ruby-forum.com> wrote:
> Yi Wen wrote:
>> Hello,
>> according to this post:
>> http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
>> I should be able to write:
>> describe User do
>>   it {should valdate_presence_of(:login)}
>> end
> What's the point in testing validates_presence_of for a model? It's
> already tested in the framework, and so readable that a quick glance on
> the model says it all. I would only test it if I added some bizarre
> behavior with procs and so on.

Question for folks who don't like writing any examples for this kind
of thing (including scenarios/steps). If I go tuck away some behaviour
behind a nice declarative interface, will you not care about having
examples showing that your objects utilize that behaviour?

Not testing things that have no logic makes sense. However, validation
methods have logic, it's just wrapped up behind a nice interface.

> What's the community's position about that?
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Zach Dennis

More information about the rspec-users mailing list