On Dec 16, 2007 10:32 AM, Francis Hwang <[EMAIL PROTECTED]> wrote: > Once again, here's something I haven't figured out. Apologies if this > is too newb-ish, but, how do I spec my routes using RSpec-Rails? > > In particular, I've got a catch-all route that needs to catch a wide > variety of URLs: > > map.document '*url', :controller => 'documents', :action => 'show' > > Is there a way to have a controller spec test site-wide routing? It > seems to me that the get and post methods are just controller- > specific routing. If I can't do it in a controller spec, where else > should I do it?
Check out route_for and params_from at http://rspec.info/rdoc-rails/. There are examples of their use in the controller examples generated by 'script/generate rspec_scaffold ...'. Here are a couple of examples: http://pastie.caboo.se/129301 Cheers, David > > Thanks, > > Francis Hwang > http://fhwang.net/ > > > > _______________________________________________ > rspec-users mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
