[rspec-users] specs for attributes with default values on the SQL layer

svoop svoop at delirium.ch
Sat Apr 18 06:09:45 EDT 2009

Pat Maddox <pat.maddox at ...> writes:
> Okay I must be dense because I'm not sure what you mean by it gets in
> the way of refactoring.

Actually, scratch that, because...

> And you're right about how it behaves...that's exactly how default
> attrs work.  If you want to test that your model doesn't allow invalid
> data, you have to explicitly give it invalid data.

Using .with instead of .except does the trick just fine and does just that, set
the model explicitly to invalid data.

Cheers, -sven

More information about the rspec-users mailing list