[rspec-users] Troubles with route_for

Nick Hoffman lists at ruby-forum.com
Sat Jan 23 22:24:51 EST 2010


Hey guys. I have two different paths that lead to the same controller 
and action:
  map.connect 'foods/search/:name', :controller => 'foods', :action => 
'search'
  map.food    ':name',              :controller => 'foods', :action => 
'search'

Unfortunately, the spec for the second route fails because #route_to 
finds and uses the first route when generating the path for
  :controller => 'foods', :action => 'search', :name => 'almonds'

routes.rb: http://codepad.org/CjKRynr5
specs:     http://codepad.org/838oV3mW

Is there a solution to this problem?

Thanks,
Nick
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list