I have a custom helpers path lib/helpers, which i autoload by adding following in application.rb:
config.autoload_paths += %W(classes helpers).map{|dir| "#{Rails.root}/lib/#{dir}"}
One of the helpers, VideoHelper, utilizes FileHelper in one of it's methods:
class VideoHelper
def my_method
FileHelper::my_method
end
end
While testing VideoHelper's my_method with rspec, all calls to FileHelper::my_method fail with:
NameError:
uninitialized constant VideoHelper::FileHelper
Tests succeed if i add call to FileHelper before VideoHelper class declaration:
FileHelper
class VideoHelper
def my_method
FileHelper::my_method
end
end
Do i have to require FileHelper in VideoHelper even when it's declared in autoload_paths?