I'm using rspec-rails to test my application and devise for my authentication solution.
As a lot of us, I ended up with the common error : undefined method authenticate' for nil:NilClass
which I resolved partially by adding this line as suggested in the README :
config.include Devise::TestHelpers, type: :controller
The error goes away for controller's tests, but it was still there for my view's tests. I finally completely resolved it by adding :
config.include Devise::TestHelpers, type: :view
But I'm not sure if it's the right things to do since I've never seen it before anywhere.
Also, can we include it for every type like config.include Devise::TestHelpers, type: :all
?
Thanks for the clarification