Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

  • Blog Navigation
Adding Routes for tests / specs with Rails 3

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.

  1. Austin Putman says:

    Nice technique for longer tests. For single tests, you can also use a **with_routing** block

  2. Jeff Dean says:

    Thanks Austin! If I had known that it would have saved me a few hours. I’ve updated the post to show an example of how to reuse with_routing across multiple tests.

  3. Jeff Dean says:

    Very slick – thanks!

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *

Share This