Named routes in controller not working?

I have some "redirect_to"s using named routes in a controller that work
fine in the browser, but choke my tests. The route in question is
“new_session” and comes from a “map.resource :session, :controller =>
:session” route mapping. If I replace the named route in the controller
with controller/action the tests run just fine, but for some reason it
doesn’t know of the named route.

I found some previous posts that seemed related, but they’re 4+ months
old, and appeared to have been resolved. Do I need to do something
special
to get named routes working?

On Tue, 16 Oct 2007 06:45:53 +0000, Steve wrote:

I have some "redirect_to"s using named routes in a controller that work
fine in the browser, but choke my tests. The route in question is
“new_session” and comes from a “map.resource :session, :controller =>
:session” route mapping. If I replace the named route in the controller
with controller/action the tests run just fine, but for some reason it
doesn’t know of the named route.

I found some previous posts that seemed related, but they’re 4+ months
old, and appeared to have been resolved. Do I need to do something special
to get named routes working?

I just looked at the output again, and saw something strange. The output
includes something that seems to have to do with haml. I’m not sure if
that has anything to do with the problem.

undefined local variable or method new_session' for #<SessionController:0xb71b2d64> /trunk/app/controllers/session_controller.rb:20:indestroy’
/trunk/vendor/plugins/haml/lib/sass/plugin.rb:124:in
`process_without_test’
./spec/controllers/session_controller_spec.rb:14:

Nevermind, I newbed the named route. It’s obviously too late, and I
should
be in bed.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs