[rspec-users] get to a different controller

David Chelimsky dchelimsky at gmail.com
Tue Jan 5 16:37:06 EST 2010

On Tue, Jan 5, 2010 at 2:53 PM, Phillip Koebbe <phillipkoebbe at gmail.com>wrote:

> Subclass it in your spec with
>> class TestController < Admin::BaseController
>>   def index
>>   end
>> end
>> ...then use the TestController in your tests for Admin::BaseController.
>> That might mean you'll need to add special routing for TestController
>> which is annoying but can be done.
> Thanks, Matt. Between your post and David's, I'll see if I can put it all
> together.

Phillip - one thing to keep in mind is that subclasses can always override
super class behaviour. So on the one hand, we want to minimize duplication
and only spec one thing once. On the other hand, if we're spec'ing that
every controller should behave some way, we should spec every controller.
I'm not advocating one approach or the other, just pointing out a couple of

> Peace,
> Phillip
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100105/64feff5b/attachment.html>

More information about the rspec-users mailing list