uc = UserController.new class << uc def authenticate_user! end def current_user @current_user ||= User.first || User.new @current_user.id ||= 'bogus_user' @current_user end def request ActionDispatch::Request.new({}) end end uc.instance_variable_set('@_request', uc.request) for action in uc.action_methods if File.exist?(Rails.root.join('app', 'views', 'user', "#{action}.html.slim")) puts "action #{action} found" result = uc.render_to_string(action: action.dup) end end view = view = ActionView::Base.new(uc.view_paths) class << view include ApplicationHelper include Rails.application.routes.url_helpers def current_user User.first || User.new end def protect_against_forgery? false end end # view.render() binding.pry