ambition/config/application.rb

38 lines
1.5 KiB
Ruby
Raw Normal View History

2016-12-03 14:15:00 +08:00
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Workspace
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.
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
# 设置时区为北京时间
config.time_zone = 'Beijing'
config.active_record.default_timezone = :local
config.generators do |g|
g.test_framework :rspec,
fixtures: true, #为各模型生成测试固件
view_specs: false, #不生成“视图测试”
helper_specs: false, #生成控制器时不生成对应的帮助方法测试文件
routing_specs: false, #不生成针对 config/routes.rb 的测试文件
2016-12-11 11:01:55 +08:00
controller_specs: true, #自动生成controller测试
request_specs: false
g.fixture_replacement :factory_girl, dir: "spec/factories"
end
2016-12-03 14:15:00 +08:00
end
end