jeroen.knoops-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-17 14:49 UTC
Testing webservices in Integration Tests with Jamis Buck''s recipe?
Hello, I''m using Jamis Buck''s recipe to do integration tests on an application, but I got a nil.recycle! error while doing a webservice call. This is the situation. def test_uploading_data invoke :upload, data invoke :upload, even_more_data real_user_session = new_session_as @real_user real_user_session.press_magic_button_to_enable_more_uploads invoke :upload, super_new_data end Test test results in a nil.recycle! error message on the last invoke: NoMethodError: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.recycle! /usr/lib/ruby/gems/1.8/gems/actionwebservice-1.2.1/lib/ action_web_service/test_invoke.rb:32:in `prepare_request'' /usr/lib/ruby/gems/1.8/gems/actionwebservice-1.2.1/lib/ action_web_service/test_invoke.rb:9:in `invoke'' It seems that the default @request in the setup is corrupted by our open_session implementation? Can somebody help me on this? Best regards, Jeroen Knoops --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Eric Budd
2008-Mar-03 20:35 UTC
Re: Testing webservices in Integration Tests with Jamis Buck
Hi Jeroen, I was having exactly this error in my functional tests. I added the following method to my test class: def setup @controller = MyController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new end ...and everything went through fine. Hope that helps! - Eric Budd jeroen.knoops-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Hello, > > I''m using Jamis Buck''s recipe to do integration tests on an > application, but I got a nil.recycle! error while doing a webservice > call. > > This is the situation. > > def test_uploading_data > invoke :upload, data > invoke :upload, even_more_data > > real_user_session = new_session_as @real_user > real_user_session.press_magic_button_to_enable_more_uploads > > invoke :upload, super_new_data > end > > Test test results in a nil.recycle! error message on the last invoke: > > NoMethodError: You have a nil object when you didn''t expect it! > The error occurred while evaluating nil.recycle! > /usr/lib/ruby/gems/1.8/gems/actionwebservice-1.2.1/lib/ > action_web_service/test_invoke.rb:32:in `prepare_request'' > /usr/lib/ruby/gems/1.8/gems/actionwebservice-1.2.1/lib/ > action_web_service/test_invoke.rb:9:in `invoke'' > > It seems that the default @request in the setup is corrupted by our > open_session implementation? > Can somebody help me on this? > > Best regards, > Jeroen Knoops-- 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 -~----------~----~----~----~------~----~------~--~---