Hi all, I wanted to test my helpers so I installed ZenTest and now I want to use HelperTestCase. I created a testcase: http://pastie.caboo.se/97432 But I get an NameError. Can somebody help me with fixing this? I edited the test_helper.rb to require test/rails. This the error I get: http://pastie.caboo.se/97431 Thanks in advance! -- 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-/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 -~----------~----~----~----~------~----~------~--~---
On 9/15/07, Leon Bogaert <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi all, > > I wanted to test my helpers so I installed ZenTest and now I want to use > HelperTestCase. I created a testcase: > http://pastie.caboo.se/97432 > > > But I get an NameError. Can somebody help me with fixing this? I edited > the test_helper.rb to require test/rails. > > This the error I get: > http://pastie.caboo.se/97431HelperTestCase is a class inside Test::Rails, so you need to either: include Test::Rails class ApplicationHelperTest < HelperTestCase or class ApplicationHelperTest < Test::Rails::HelperTestCase I usually use the second form. BTW, excellent way to ask a question (hint to others: paste your code!) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Fixed the error. I did: class ApplicationHelperTest < Test::Rails::HelperTestCase instead of: class ApplicationHelperTest < HelperTestCase But now I have this new error: http://pastie.caboo.se/97544 It complains about not finding the method logged_in? I created the login-system with acts_as_authenticated. I also included the AuthenticatedTestHelper in my ApplicationHelperTest, but it doesn''t work. Does anyone know why I get this error? Thanks again! -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Yes! Fixed it: Had to include: include ActionController::Helpers include AuthenticatedSystem include AuthenticatedTestHelper -- 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-/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 -~----------~----~----~----~------~----~------~--~---