For controllers that assume a user to be already authenticated, how should I go about writing my tests?
I probably don't need to keep testing the login feature, so is it best to just inject a user or whatever my authentication assumes somehow?
My application_controller includes a module "current_user".
module CurrentUser
def self.included(base)
base.send :helper_method, :current_user
end
def current_user
... # returns a User model instance
end
end
class ApplicationController < ActionController::Base
include CurrentUser
Then I have an admin controller which has a before_action method that makes sure the current_user is present.
include CurrentUsermakes me think no devise.