[rspec-users] Speccing a redirect in routes

Matt Wynne matt at mattwynne.net
Mon Aug 8 19:00:51 EDT 2011


I expected to be able to do something like this in a routing spec:

{ :get => '/legacy/route' }.should redirect_to('/shiny/new/route')

However there doesn't appear to be a redirect_to matcher, and digging deeper I can't even see an underlying Rails assertion method that will assert for redirect routing configuration. Did I miss it?

Do I need to spec this with a request spec instead?


Freelance programmer & coach
Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy)
Founder, http://relishapp.com
+44(0)7974430184 | http://twitter.com/mattwynne

More information about the rspec-users mailing list