[Rails] Shoulda Question: how to test validates_inclusion_of...?
I'm using thoughtbot's shoulda, and I have this in a model:
validates_inclusion_of :year, :in => %w[ 09-10 10-11 ]
where :year is of type string. How do I test this in shoulda? Is it
with
(1) should ensure_inclusion_of
or do I have to do
(2) should allow_value('09-10').for(:year) and the should_not
equivalents?
So? (2) seems verbose... I mean, having to do a bunch of should's and
should_not's?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home