[rspec-users] Troubles with route_for

David Chelimsky dchelimsky at gmail.com
Mon Jan 11 08:46:54 EST 2010


On Sun, Jan 10, 2010 at 10:58 PM, Nick Hoffman <lists at ruby-forum.com> 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?
>

I'd recommend using the route_to matcher that was added in 1.2.9 instead.

http://codepad.org/fLcxyA9N
http://rspec.rubyforge.org/rspec-rails/1.2.9/classes/Spec/Rails/Matchers.html#M000029

It's more reliable, and aligns better with the rspec matchers API.

Cheers,
David


>
> Thanks!
> Nick
>
> PS: I'm using 1.2.9 and Rails 2.3.4 .
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100111/f7b5856d/attachment.html>


More information about the rspec-users mailing list