require 'rails' require 'action_controller/railtie' class Dummy < Rails::Application config.root = File.dirname(__FILE__) # Rails needs these keys, but they don't really have to be secret for our tests config.session_store :cookie_store, key: '****************************************' config.secret_token = '****************************************' # Our routes routes.draw do mount MongoRequestLogger::Viewer, :at => "log" get '/' => 'dummy#index' post '/' => 'dummy#index' get '/other' => 'dummy#other' end end # A simple controller class DummyController < ActionController::Base def index render text: 'Home' end def other render text: 'Other' end end # Not sure how to make Rails automatically run the railtie with a dummy app, so we do it manually. # In a proper Rails app we don't need this. require 'mongo_request_logger/railtie' MongoRequestLogger::Railtie.setup(Rails.application)