[rspec-users] get to a different controller
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
>> ...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
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
> rspec-users mailing list
> rspec-users at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users