Test for required attributes


/ Published in: Ruby
Save to your folder(s)

A fairly DRY way to test for required attributes of a model. It's sort of an alternative to fixtures. It breaks the one-assertion-per-test rule that some people favor. Drop in your unit test and edit as necessary.

A better (yet not quite perfect) approach:
http://johnwilger.com/articles/2005/12/07/a-bit-of-dryness-for-unit-tests-in-rails

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.