Check out the code that instantiates it at https://github.com/rails/rails/blob/master/railties/lib/rail...
require 'action_controller/integration' app = ActionController::Integration::Session.new module CurrentUserHack def current_user @user ||= User.look_up_my_user_here end end ApplicationController.send :include, CurrentUserHack