I''ve got an interesting (possibly) problem right now between autotest and rails integration tests. There are a few things to preface this with. Works fine: rake test rake test:integration Blows up: autotest Autotest is correctly determining rails and runs tests just fine. One part of the behavior is that if I save a change in just the integration test (even hitting cmd+s to trigger a diff) the tests execute fine. Running all the tests from functional to integration to unit, however, and the integration tests blow up.>From what I can tell it runs into follow_redirect! and goes into ahissy fit, and delivers this error message: Runtime Error: not a redirect! 500 Internal c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/integ ration.rb:115:in `follow_redirect!'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/integ ration.rb:547:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/integ ration.rb:547:in `method_missing'' ./test/integration/new_user_test.rb:20:in `test_foo'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/integ ration.rb:453:in `run'' At this point I''d guess it''s something going on with how the db''s get cloned/purged but honestly am too much of a novice to guess much further past that. I''m also not sure how to get autotest to reset the db after every pass. The useful information I gathered on tests like this blowing up in some cases but not others basically said add fixtures - I linked against everything I had, with no changes. Any advice? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bob Showalter
2007-Jul-25 15:15 UTC
Re: autotest + integration testing (follow_redirect!) error
On 7/25/07, Jim Truher <jtruher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''ve got an interesting (possibly) problem right now between autotest > and rails integration tests. There are a few things to preface this > with. > > Works fine: > rake test > rake test:integration > > Blows up: > autotest > > Autotest is correctly determining rails and runs tests just fine. One > part of the behavior is that if I save a change in just the > integration test (even hitting cmd+s to trigger a diff) the tests > execute fine. Running all the tests from functional to integration to > unit, however, and the integration tests blow up....> The useful information I gathered on tests like > this blowing up in some cases but not others basically said add > fixtures - I linked against everything I had, with no changes. Any > advice?What do you mean by "I linked against everything I had?" Do you mean you''re loading all your fixtures in every test case? I suspect it has something to do with interactions between fixtures being loaded in one test case but not another. You might want to add an assert_response :redirect before the follow_redirect! (That won''t fix the error obviously). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jim Truher
2007-Jul-25 20:47 UTC
Re: autotest + integration testing (follow_redirect!) error
Correct - I''ve tried adding all the fixtures available, no change. There is an assert_response :redirect before the follow. Also just for debugging I threw a few lines of puts status in various places (since that''s what follow_redirect! is interested in). Passing tests, get normal numbers - 302, 302, 200, etc. Failing tests, get 500''s, so it looks like however it''s bringing up whatever server for testing isn''t being done correctly? On Jul 25, 8:15 am, "Bob Showalter" <showa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7/25/07, Jim Truher <jtru...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > I''ve got an interesting (possibly) problem right now between autotest > > and rails integration tests. There are a few things to preface this > > with. > > > Works fine: > > rake test > > rake test:integration > > > Blows up: > > autotest > > > Autotest is correctly determining rails and runs tests just fine. One > > part of the behavior is that if I save a change in just the > > integration test (even hitting cmd+s to trigger a diff) the tests > > execute fine. Running all the tests from functional to integration to > > unit, however, and the integration tests blow up. > > ... > > > The useful information I gathered on tests like > > this blowing up in some cases but not others basically said add > > fixtures - I linked against everything I had, with no changes. Any > > advice? > > What do you mean by "I linked against everything I had?" Do you mean > you''re loading all your fixtures in every test case? I suspect it has > something to do with interactions between fixtures being loaded in one > test case but not another. > > You might want to add an assert_response :redirect before the > follow_redirect! (That won''t fix the error obviously).--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Michael Johnston
2008-Feb-14 06:23 UTC
Re: autotest + integration testing (follow_redirect!) error
Did you ever solve this issue? I''m running into (probably) the same issue, however I don''t think it has anything to do with redirects. Rather in the second, failing case, the http headers of the response are incomplete. In my case, i am simply asserting that a response had error code 500 (because an uncaught exception was thrown). The headers look like this: (rake test or autotest first run after saving integration test) @response.headers: {"Status"=>"500 Internal Server Error", "type"=>"text/html; charset=utf-8", "cookie"=>[], "Cache-Control"=>"no-cache", "Content-Length"=>11061} and in the second, failing run of autotest: @response.headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} So far I haven''t isolated what the difference is, and before I spend too much time digging thought I''d check if anyone had already solved this issue. Jim Truher wrote:> Correct - I''ve tried adding all the fixtures available, no change. > There is an assert_response :redirect before the follow. Also just > for debugging I threw a few lines of puts status in various places > (since that''s what follow_redirect! is interested in). Passing tests, > get normal numbers - 302, 302, 200, etc. Failing tests, get 500''s, so > it looks like however it''s bringing up whatever server for testing > isn''t being done correctly?-- 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 -~----------~----~----~----~------~----~------~--~---