On Wed, 18 Feb 2009 16:25:18 +0100
Joaquin Rivera Padron <[email protected]> wrote:
> hey there,
> I have a model which different contexts, e.g:
>
> class Article
> ...
> validates_present :user, :when => [:publish]
> ...
> end
>
> how could I spec this:
> @article.user = nil
> @article.should_not be_valid_for_publish_context
> but it should be for others
>
You're almost there with the method name:
@article.should_not be_valid_for_publish
Although the method you used in your follow up email is just as valid.
Regards,
Jon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---