well I get this would do it:
@article.valid?(:publish).should be_false

is that so? you do it different?

cheers
joaquin

2009/2/18 Joaquin Rivera Padron <[email protected]>

> 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
>
> any ideas?
> thanks in advance
> joaquin
>



-- 
www.least-significant-bit.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to