[rspec-users] rspec-rails - expected helper_method behaviour in view specs

Jonathan del Strother jdelstrother at gmail.com
Tue Nov 9 19:18:47 EST 2010


Say I had the following app controller :
class ApplicationController<ActionController::Base
  def logged_in?
  helper_method :logged_in?

Under a rspec-rails1 view-spec, a view template would be able to call
logged_in?.  It seems this behaviour has gone away in rspec-rails2.
Was this behaviour intentional?  What's the recommended alternative -
mixing in a helper to stub out all these methods with
config.include(HelperMethodsStubber, :type=>:view)  ?

In addition, rspec-rails1 used to mix all helpers into the view
template, right?   rspec-rails2 mixes in only the ApplicationHelper
and the helper for the current spec, but this seems a strange choice
when Rails includes all helpers by default.

Any thoughts?


More information about the rspec-users mailing list