should_require_attributes doesn't play nice with validate callback

3 views
Skip to first unread message

Andy Ferra

unread,
Aug 15, 2008, 9:42:40 PM8/15/08
to shoulda
I know there have been similar post about this but as far as I've
reviewed the points they cover (I think) and it's still not working.

Things I can say about the code:
- validates_presence_of is being declared correctly
- valid? returns true
- a record for the tests to hit is being create (via Factory)
- IF I change validate it validate_on_create the test passes BUT,
fails when set to validate_on_update

Here's the code:
http://pastie.textmate.org/private/6w9v22nxkmmggsvrqaqifw

Thanks,
Andy

Andy Ferra

unread,
Aug 15, 2008, 9:55:20 PM8/15/08
to shoulda
Ok, I just had a modified the validation method so it doesn't throw
errors when the values aren't set.
http://pastie.org/253975

But, I still don't understand why the test fails because the record
isn't empty.

Anyone care to explain?
Reply all
Reply to author
Forward
0 new messages