require File.expand_path('../boot', __FILE__)

require "rails"

Bundler.require(*Rails.groups)

module Challenge
  class Application < Rails::Application
    config.secret_key_base = ENV["SECRET_KEY_BASE"]

    config.generators do |g|
      g.orm :mongoid
      g.javascripts false
      g.stylesheets false
      g.helper false
      g.test_framework :rspec,
                       fixture: true,
                       view_specs: false,
                       helper_specs: false,
                       routing_specs: false,
                       controller_specs: true,
                       request_specs: true
      g.fixture_replacement :factory_girl, dir: 'spec/factories'
    end

    # config.active_record.raise_in_transactional_callbacks = true

    require 'http_method_not_allowed'
    config.middleware.insert_before(0, HttpMethodNotAllowed)
  end
end
