scinote-web/config/environments/test.rb

102 lines
3.6 KiB
Ruby
Raw Normal View History

2016-02-12 23:52:43 +08:00
Rails.application.configure do
2017-08-30 22:18:21 +08:00
2016-02-12 23:52:43 +08:00
# Settings specified here will take precedence over those in config/application.rb.
2017-08-30 22:18:21 +08:00
config.after_initialize do
Bullet.enable = true
Bullet.bullet_logger = true
Bullet.raise = true # raise an error if n+1 query occurs
end
2016-02-12 23:52:43 +08:00
2017-06-23 21:19:08 +08:00
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
}
2016-02-12 23:52:43 +08:00
# Enable this to be able to output stuff to STDOUT during tests
# via Rails::logger.info "..."
config.logger = Logger.new(STDOUT)
config.log_level = :info
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Configure static file server for tests with Cache-Control for performance.
config.serve_static_files = true
config.static_cache_control = 'public, max-age=3600'
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
Rails.application.routes.default_url_options = {
host: Rails.application.secrets.mail_server_url
}
2016-02-12 23:52:43 +08:00
# Don't care if the mailer can't send.
config.action_mailer.default_url_options = { host: Rails.application.secrets.mail_server_url }
config.action_mailer.default_options = { from: Rails.application.secrets.mail_from }
config.action_mailer.raise_delivery_errors = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: Rails.application.secrets.mailer_address,
port: Rails.application.secrets.mailer_port,
domain: Rails.application.secrets.mailer_domain,
authentication: Rails.application.secrets.mailer_authentication,
2016-02-12 23:52:43 +08:00
enable_starttls_auto: true,
user_name: Rails.application.secrets.mailer_user_name,
password: Rails.application.secrets.mailer_password
}
#config.action_mailer.perform_deliveries = false
# Randomize the order test cases are executed.
config.active_support.test_order = :random
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
config.logger = Logger.new(STDOUT)
config.log_level = :error
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
2017-02-27 16:40:01 +08:00
# Enable/disable Deface
config.deface.enabled = ENV['DEFACE_ENABLED'] != 'false'
2017-02-27 16:40:01 +08:00
2016-11-22 21:57:41 +08:00
# Enable reCAPTCHA
config.x.enable_recaptcha = false
# Enable email confirmations
config.x.enable_email_confirmations = false
# Enable user registrations
config.x.enable_user_registration = true
2017-07-06 15:07:05 +08:00
2018-04-04 21:29:20 +08:00
# disable sign in with LinkedIn account
config.x.linkedin_signin_enabled = false
2017-07-06 15:07:05 +08:00
# prevents compile assets
config.assets.compile = false
2016-02-12 23:52:43 +08:00
end