[rspec-users] Understanding routing specs that use constraints

Joseph DelCioppio joseph.delcioppio at gmail.com
Wed Oct 27 12:49:50 EDT 2010


Hello all,

I'm trying to perform a pretty simple routing constraint

Here are my routes, my constraint, and my spec. http://gist.github.com/649430

As you can see, I've attempted to stub my RootConstraints.matches?
method to just return true or false.  However, this doesn't seem to
work correctly.  Even when I stub RootConstraints.matches? to return
false, it still always routes root to :controller => "lists", :action
=> "show", :id => "name".

Here is the error that I receive:  http://gist.github.com/649432


Can anybody enlighten me as to why this happens?

Thanks,

Joe


More information about the rspec-users mailing list