1
votes

I'm testing a Rails (3.2.18) app and I'm having some trouble referencing view helpers in my RSpec (2.14.1) view specs.

The view specs fail because views can't access helper methods defined in app/helpers, nor those controller methods that have been marked as helpers.

I guess that I can stub my way out of this, but I was wondering if it can be solved with a simple configuration tweak.

1

1 Answers

5
votes

Try to add this setting to your spec/spec_helper.rb configs:

RSpec.configure do |config|
  config.include ApplicationHelper
end