Getting the following Failures in my unit test. Can someone point me in the right direction?: 1) Failure: test_email_with_invalid_examples(UserTest) [./test/unit/user_test.rb:134:in `test_email_with_invalid_examples'' ./test/unit/user_test.rb:131:in `each'' ./test/unit/user_test.rb:131:in `test_email_with_invalid_examples'']: <"must be a valid email address"> expected but was <["must be a valid email address", "must be valid."]>. Thanks for your help 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think you must be checking model.errors rather than model.errors.on(:email). If you post your UserTest for test_email_with_invalid_examples I might be able to help. On Nov 18, 11:21 am, specpro <specpr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Getting the following Failures in my unit test. Can someone point me > in the right direction?: > > 1) Failure: > test_email_with_invalid_examples(UserTest) > [./test/unit/user_test.rb:134:in > `test_email_with_invalid_examples'' > ./test/unit/user_test.rb:131:in `each'' > ./test/unit/user_test.rb:131:in > `test_email_with_invalid_examples'']: > <"must be a valid email address"> expected but was > <["must be a valid email address", "must be valid."]>. > > Thanks for your help > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think I found the problem already. I had two tests that were checking for the same thing and when I commented out the tests that returns "must be valid" the failure went away and the test/assertion passed ok. does that sound right to you? thanks for your help! s On Nov 19, 7:18 am, Nicholas Henry <nicholas.he...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I think you must be checking model.errors rather than > model.errors.on(:email). If you post your UserTest for > test_email_with_invalid_examples I might be able to help. > > On Nov 18, 11:21 am, specpro <specpr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Getting the following Failures in my unit test. Can someone point me > > in the right direction?: > > > 1) Failure: > > test_email_with_invalid_examples(UserTest) > > [./test/unit/user_test.rb:134:in > > `test_email_with_invalid_examples'' > > ./test/unit/user_test.rb:131:in `each'' > > ./test/unit/user_test.rb:131:in > > `test_email_with_invalid_examples'']: > > <"must be a valid email address"> expected but was > > <["must be a valid email address", "must be valid."]>. > > > Thanks for your help > > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---