Randy Schmidt on 13 Sep 2007 19:46:38 -0000

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] rspec slides

  • From: "Randy Schmidt" <randy@umlatte.com>
  • To: talk@phillyonrails.org
  • Subject: Re: [PhillyOnRails] rspec slides
  • Date: Thu, 13 Sep 2007 15:46:19 -0400
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=l7WGSueE8G/1AFnvablOuLY50auS2TbE2PXYyKwVJfg=; b=DWN1vMBPUfdFJ97JX59VJ58U9MfL6f+Oas+BIEUDenZyp5xfle0Aq07nmS1j2YGhu29SKLM4IY/vrY4H097Z4LvndTJmB7V4b4vBbfVaLVDvogQhVq80IPyMIjZ/0ribcdDLQ0uFPWxhS1X8vRzThU11DBXIznd0i+bamY/NxjM=
  • List-archive: <http://lists.phillyonrails.org/pipermail/talk>
  • Reply-to: talk@phillyonrails.org
  • Sender: talk-bounces@phillyonrails.org

> 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

But yeah, testing those bits is less of a priority than testing the
tricky bits and business logic.

Randy Schmidt
To unsubscribe or change your settings, visit: