should_allow_values_for doesn't catch fails if message option is different
Reported by gary.tsang (at gmail) | March 4th, 2008 @ 05:50 PM
Here is an example of the problem:
should_not_allow_values_for :email, "blah" #this will pass
should_allow_values_for :email, "blah", :message => "not the same message as validation" #this will also pass
I've re-factored the helper to assert on the absence of an error for the attribute, rather than the message that is associated with the error.
Attached is a patch.
Thanks!
Comments and changes to this ticket
-
Tammer Saleh March 10th, 2008 @ 10:27 AM
- → State changed from new to resolved
Thanks Gary,
This has been committed to trunk. I left the call to get_options! in place, as that will raise if the message parameter is passed in.
Cheers,
Tammer
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
