Gwyn Morfey
2007-Mar-12 10:41 UTC
Can''t follow redirects outside current controller - but it''s the same controller
Running a functional test on FooController that does ''follow_redirect'', I get ''Can''t follow redirects outside current controller (from "foo" to "foo"). On further investigation, it turns out that :foo != ''foo'' around line 401 of actionpack/lib/ action_controller/test_process.rb. Changing the line: if redirected_controller && redirected_controller !@controller.controller_name to if redirected_controller && redirected_controller.to_s !@controller.controller_name.to_s fixes the problem. Has anyone else hit this? The method in question is just doing ''redirect_to :action=>:someaction''. Gwyn. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gwyn Morfey
2007-Mar-12 11:01 UTC
Re: Can''t follow redirects outside current controller - but it''s the same controller
It seems that the proper form of redirect_to is: redirect_to :controller=>''foo'',:action=>''bar'', Not: redirect_to :controller=>:foo,:action=>:bar Consistently using strings in both redirect_to and assert_redirected_to fixes this problem. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---