[rspec-users] Troubles with route_for

Nick Hoffman lists at ruby-forum.com
Tue Jan 12 12:25:20 EST 2010

Randy Harmon wrote:
> On 1/11/10 9:22 PM, Nick Hoffman wrote:
>>> Cheers,
>>> David
>> Thanks for that, David. I updated my spec (http://codepad.org/F828X7Fg). 
>> For some reason though, it's still failing: http://codepad.org/s65Ckubc
>> Just in case, this is what I have in routes.rb: 
>> http://codepad.org/rJfIhbM6
>> There must be some tiny detail that I'm missing here...
> Yes, there must.  I think you've tried to twice define the route, and
> the test shows you which one actually is being used.  I'll suggest
> commenting out one of those routes at a time, and see whether the new
> test results are illuminating.
> Randy

I swapped the order of the 2 lines in routes.rb to this:

    map.connect   'foods/search/:name', :controller => 'foods', :action 
=> 'search'
    map.resources :foods, :collection => {:search => :get}

and the spec passes now.

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

More information about the rspec-users mailing list