[rspec-users] Missing template in helper specs with a render

Matt Wynne matt at mattwynne.net
Sat Jun 6 07:16:59 EDT 2009


On 6 Jun 2009, at 04:40, David Chelimsky wrote:

> On Thu, Jun 4, 2009 at 8:41 PM, Charlie Bowman <charlesmbowman at gmail.com 
> > wrote:
>> I have a helper method that does a "render :partial".  The method  
>> works fine
>> within the app (Rails 2.3.2).  In rspec (1.2.6) I get an error  
>> ("Missing
>> template /comments/_comment.erb in view path"
>> It seems that rspec when running helper tests doesn't set the  
>> view_path so
>> rails doens't know where to look for the templates.  Is there a way  
>> to run
>> helper specs with the same setup as controller specs?
>
> There is no support for rendering in helper specs as of yet. Please
> file a feature request if you think there should be. I have,
> personally, never rendered from a helper. Anybody else?

Yep, I quite often have helper methods that wrap a call to  
render_partial, but they'd just get tested as part of the main view  
render, or by the cukes.

Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com



More information about the rspec-users mailing list