[rspec-users] Troubles with route_for

Amit Kulkarni lists at ruby-forum.com
Mon Jan 11 01:40:11 EST 2010


Nick Hoffman wrote:
> Hey guys. I'm having some trouble with a route spec. In routes.rb , I
> have:
>     map.connect 'foods/search/:name', :controller => :foods, :action =>
> :search
> 
> foods_controller_spec.rb has: http://codepad.org/dg3FERKw
> Unfortunately, that fails: http://codepad.org/lck4r1S0
> 
> After reading the rspec-rails 1.2.0 upgrade notes (http://tr.im/K1zx), I
> haven't been able to figure out what I'm doing wrong. Any hints?
> 
> Thanks!
> Nick
> 
> PS: I'm using 1.2.9 and Rails 2.3.4 .
Hi Nick,
You need to add quotes while writing in routs.rb file.
So your route will be define as :
map.connect 'foods/search/:name', :controller => 'foods', :action => 
'search'
Now try running the code again.You will see it pass.
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list