David K. wrote in post #1018921: > On Sun, Aug 28, 2011 at 10:29 AM, Ezequiel Schwartzman > <li...@ruby-forum.com > > In my book this is fine.... you have a list of specific examples and it > is > clear what you are doing. I might go further and make sure that in fact > it > is the email which is valid/invalid vs just checking the model (at least > in > the case if you are checking what should be invalid data) as another > field > could be the invalid one. > > I also like shoulda as you get helpers like: > > it { should allow_value('david.n_k...@gmail.com.mx').for(:email) } > it { should_not allow_value('david nathan kahn at gmail dot > com').for(:email) }
Thanks! I'm looking into shoulda now, it seems very useful! ^^ -- Posted via http://www.ruby-forum.com/. -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.