A method on a controller uses the redirect_to :back (new in 0.14.x).
It works fine in normal use but a functional test that calls this
method will recurse infinitely. I assume that the :back destination in
the test case points to itself.

Im not seeing an elegant way to keep this from happening. If you have
an idea or know of something that should be done in this case, please
let me know.

example:
$ cat app/controllers/abc_controller.rb
class AbcController < ApplicationController

 def some_stuff
   redirect_to :back
 end
end
$ cat test/functional/abc_controller_test.rb
[stuff left out for brevity]
  def test_back
    get :some_stuff
  end
[stuff]
$ rake
Started
E
Finished in 1.11912 seconds.

  1) Error:
test_back(AbcControllerTest):
SystemStackError: stack level too deep
    
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/base.rb:757:in
`redirect_to'
    
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/base.rb:757:in
`redirect_to'
    
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/base.rb:753:in
`redirect_to'
    /home/donp/work/arbug/config/../app/controllers/abc_controller.rb:4:in
`some_stuff'
_______________________________________________
PDXRuby mailing list
[email protected]
IRC: #pdx.rb on irc.freenode.net
http://lists.pdxruby.org/mailman/listinfo/pdxruby

Reply via email to