The title is self explanatory.
Everything I\'ve tried led to a \"undefined method\".
To clarify, I am not trying to test a helper method. I am trying to use a he
Based on Thomas Riboulet's post on Coderwall:
At the beginning of your spec file add this:
def helper
Helper.instance
end
class Helper
include Singleton
include ActionView::Helpers::NumberHelper
end
and then call a particular helper with helper.name_of_the_helper
.
This particular example includes the ActionView's NumberHelper. I needed the UrlHelper, so I did include ActionView::Helpers::UrlHelper
and helper.link_to
.