[rspec-users] URL helpers in model specs

Nick nick at deadorange.com
Mon Oct 10 13:02:19 EDT 2011


Hey guys. One of my models uses a Rails URL helper. In IRB, the method 
works. However, when I run the specs for the method, the URL helper doesn't 
exist.

The only solution I've found is to include 
Rails.application.routes.url_helpers in both the model and the example 
group. Obviously, that's not ideal, because it's only necessary for the 
specs to work. Is there any other solution?

https://gist.github.com/1275799

Thanks,
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20111010/d64e3c5b/attachment-0001.html>


More information about the rspec-users mailing list