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

Biography

Previous
Cucumber and Sunspot…
Cucumber and Sunspot…

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

Next
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,...