[rspec-users] Test that controller includes helpers?
vertebrate at gmail.com
Sat Nov 3 11:25:26 EDT 2007
On Sat, 03 Nov 2007 02:00:56 -0400, David Chelimsky wrote:
> FWIW, by asking you to declare helpers in controllers so that views
> can access their goodness, Rails is already forcing you to cross that
> boundary. So whatever you do here is a compromise and you just need to
> find the lesser of evils.
> I think the most pragmatic thing to do would be to use a controller
> spec with integrate_views and describe what the view should look like
> when it uses one of the included methods. Alternatively could load the
> file and expect the declaration (but that's somewhat controversial on
> this list).
Yeah, I'm not terribly interested in the reloading of the file. That was
too much of a pain last time with my models and I opted not to do it. I'd
rather not integrate the view if I can avoid it. Is there a way to get at
the controller instance that was called though? If I could do that, I
could simply check for a responds_to at the very least, right? I
understand what you mean by blurring the lines though.
More information about the rspec-users