>> then i have write 1 test for validates_format_of :postcode, :with =>
>> /^\d{5}$/
>> its also ok.
> Looks to me like this regexp means that "my street" cannot match
> (since you've said that each of your words must be finished by a space
> (so i would expect "my street " to pass)).
> Other than that you need to do some detective work: what line is it
> failing on ? with what input ? which validations are failing etc.
Next advice: Comment out every test that fails, then write a test like this:
assert_match '12348', /^\d{5}/
If you have trouble with a high-level test, scratch it and write a low-level
one; one that only targets the details. In this case, you are not even testing
the actual validator; you are using the testing to learn which regexps work.
--
Phlip
http://broadcast.oreilly.com/2009/02/merb-mind-maps.html
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---