Sha256: 21e383d9db38d4947383f72185627d93d84b26bdcd98197f1f6dfc2a069d018f

Contents?: true

Size: 1.75 KB

Versions: 1

Compression:

Stored size: 1.75 KB

Contents

ENV['RAILS_ENV'] = 'test'
# require File.expand_path('../../config/environment', __FILE__)
# Load the Rails application.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.

require 'rails'

%w[
  action_controller/railtie
  action_view/railtie
  action_mailer/railtie
  active_job/railtie
  action_cable/engine
  rails/test_unit/railtie
  sprockets/railtie
].each do |railtie|
  begin
    require railtie
  rescue LoadError => error
    puts 'Unable to load libraries'
    puts error.message
  end
end

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module WebCore
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
    # Configure redis cache
    config.eager_load = false
    config.cache_store = :redis_store, 'redis://127.0.0.1:6379/11/cache'
    config.autoload_paths += %W(#{config.root}/lib #{File.join(Rails.root, 'app', 'mixins')} #{File.join(Rails.root, 'app', 'classes')})
    config.generators do |g|
      g.template_engine :haml
      g.orm :mongoid
      g.test_framework :shoulda
      g.fallbacks[:shoulda] = :test_unit
      g.fixture_replacement :factory_bot
    end
    config.active_job.queue_adapter = :delayed_job

    config.exceptions_app = ->(env) { ExceptionsController.action(:show).call(env) }
    # Configure the default encoding used in templates for Ruby 1.9.
    config.encoding = 'utf-8'
  end
end

# Initialize the Rails application.
Rails.application.initialize!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
web47core-0.0.2 test/rails_setup.rb