Hi, I''ve got a small problem with my funcional tests. I want to test the function, that anybody who wants to the admin - controller redirect to the authentication - controller. So I write this small test: def test_index get :index assert_response :redirect end But every time I get these error message: ruby test/functional/admin_controller_test.rb Loaded suite test/functional/admin_controller_test Started E. Finished in 0.313 seconds. 1) Error: test_index(AdminControllerTest): NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[] ... 2 tests, 0 assertions, 0 failures, 1 errors Has anybody an idea to solve this problem? Regards Eddy -- 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 23 Jun 2008, at 10:49, Eddy Betara wrote:> > Hi > But every time I get these error message: > > ruby test/functional/admin_controller_test.rb > > Loaded suite test/functional/admin_controller_test > Started > E. > Finished in 0.313 seconds. > > 1) Error: > test_index(AdminControllerTest): > NoMethodError: You have a nil object when you didn''t expect it! > You might have expected an instance of ActiveRecord::Base. > The error occurred while evaluating nil.[]The error message will tell you where the error occurred. Find that line and work out what is nil and why. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 23 Jun 2008, at 10:49, Eddy Betara wrote: > >> >> 1) Error: >> test_index(AdminControllerTest): >> NoMethodError: You have a nil object when you didn''t expect it! >> You might have expected an instance of ActiveRecord::Base. >> The error occurred while evaluating nil.[] > > The error message will tell you where the error occurred. Find that > line and work out what is nil and why. > > FredHe said, that this line ''get :index'' is nil, but this doesn''t make sense. He gave these answer to all my methods. Eddy -- 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 -~----------~----~----~----~------~----~------~--~---
Eddy Betara wrote:> Frederick Cheung wrote: >> On 23 Jun 2008, at 10:49, Eddy Betara wrote: >> >>> >>> 1) Error: >>> test_index(AdminControllerTest): >>> NoMethodError: You have a nil object when you didn''t expect it! >>> You might have expected an instance of ActiveRecord::Base. >>> The error occurred while evaluating nil.[] >> >> The error message will tell you where the error occurred. Find that >> line and work out what is nil and why. >> >> Fred > > He said, that this line ''get :index'' is nil, but this doesn''t make > sense. He gave these answer to all my methods. > > EddyFred you are right. He has some problems with the integration of Globalite and so I get the NoMethodError. Thanks! Eddy -- 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 -~----------~----~----~----~------~----~------~--~---