Adding Routes for tests / specs with Rails 3

August 22, 2010 Pivotal Labs

If you ever need to test an abstract base controller independently from any subclass, you’ll likely need to add a route for your test. Here’s one example of how to do this in Rails 3:

*UPDATE: * Thanks to the tip by Austin Putman I’ve updated the gist to include an example use of the excellent with_routing method.

About the Author


More Content by Pivotal Labs
Cucumber and Sunspot…
Cucumber and Sunspot…

In continuing with my Cucumber themed posts, here is a great post about using Cucumber and Sunspot together...

Using ActiveSupport::Concern for easy mix-ins…
Using ActiveSupport::Concern for easy mix-ins…

If you are writing you own mix-in modules in Rails3 and haven't taken a look at ActiveSupport::Concern yet,...


Subscribe to our Weekly Newsletter

Thank you!
Error - something went wrong!