Phlip wrote:
> Hello Guy wrote:
>
>> my English isnt so good, sorry. I dont understand everything you wrote.
>> can you give me an example for a simpler test for my situation?
>
> in your model:
>
> VALIDATE = /@#$%^/
> validates_format_of :snoo, VALIDATE
>
> in the test:
>
> def test_validate
> assert_match Model::VALIDATE, 'something'
> end
>
> That's all. Don't build everything just to test the Regexp - just test
> it directly!
ok thank you. i try this:
in model:
validates_format_of :street, :with =>
/^[[:alpha:]]+\s{1}*[[:alpha:]])*\d*$/
in test:
def test_street_try
assert_match(/^[[:alpha:]]+\s{1}*[[:alpha:]])*\d*$/, 'The Road 9')
end
but i become this:
Finished in 0,0 seconds.
0 tests, 0 failures, 0 errors
whats wrong now? i dont know
--
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 [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
-~----------~----~----~----~------~----~------~--~---