Topic: Testing private or protected methods of controller

Hello,

Is it possible to run tests on private or protected methods of a controller? I have a lot of stuff going on in this methods, and would feel safer if I could write tests while developing them.

Or would you pack functionality like this in a special HelperFile and include it within your controller when needed? Or is this a mixup of view and controller? And would the included helper-methods be accessible over the url? (they shoudn't be)

Questions over questions. Thanks for every reponse.
Sebastian

Re: Testing private or protected methods of controller

The "send" method can run private/protected methods without error:

@controller.send(:foo)

I think there's a better way to allow tests access to all private/protected methods, but I don't remember off the top of my head.

Railscasts - Free Ruby on Rails Screencasts