2015-11-25 11:18:44 -05:00
|
|
|
Rails.application.configure do
|
2017-03-09 21:28:20 -05:00
|
|
|
# Make sure the middleware is inserted first in middleware chain
|
2018-06-12 23:12:38 -04:00
|
|
|
config.middleware.insert_before(ActionDispatch::Static, Gitlab::Testing::RequestBlockerMiddleware)
|
|
|
|
config.middleware.insert_before(ActionDispatch::Static, Gitlab::Testing::RequestInspectorMiddleware)
|
2017-03-09 21:28:20 -05:00
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
# Settings specified here will take precedence over those in config/application.rb
|
|
|
|
|
|
|
|
# The test environment is used exclusively to run your application's
|
2012-11-14 08:45:15 -05:00
|
|
|
# test suite. You never need to work with it otherwise. Remember that
|
2011-10-08 17:36:38 -04:00
|
|
|
# your test database is "scratch space" for the test suite and is wiped
|
2012-11-14 08:45:15 -05:00
|
|
|
# and recreated between test runs. Don't rely on the data there!
|
2017-04-14 17:54:36 -04:00
|
|
|
|
|
|
|
# Enabling caching of classes slows start-up time because all controllers
|
2019-05-20 10:11:44 -04:00
|
|
|
# are loaded at initialization, but it reduces memory and load because files
|
2017-04-14 17:54:36 -04:00
|
|
|
# are not reloaded with every request. For example, caching is not necessary
|
|
|
|
# for loading database migrations but useful for handling Knapsack specs.
|
|
|
|
config.cache_classes = ENV['CACHE_CLASSES'] == 'true'
|
2011-10-08 17:36:38 -04:00
|
|
|
|
|
|
|
# Configure static asset server for tests with Cache-Control for performance
|
2017-10-03 10:47:56 -04:00
|
|
|
config.assets.compile = false if ENV['CI']
|
2018-03-21 18:37:57 -04:00
|
|
|
|
2018-12-07 13:15:06 -05:00
|
|
|
config.public_file_server.enabled = true
|
|
|
|
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
2018-03-21 18:37:57 -04:00
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
# 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
|
2016-05-10 22:58:06 -04:00
|
|
|
config.action_controller.allow_forgery_protection = false
|
2011-10-08 17:36:38 -04:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Print deprecation notices to the stderr
|
|
|
|
config.active_support.deprecation = :stderr
|
2013-12-06 10:04:18 -05:00
|
|
|
|
|
|
|
config.eager_load = false
|
2015-11-16 05:18:31 -05:00
|
|
|
|
|
|
|
config.cache_store = :null_store
|
2015-11-30 04:21:10 -05:00
|
|
|
|
|
|
|
config.active_job.queue_adapter = :test
|
2017-07-13 10:51:37 -04:00
|
|
|
|
|
|
|
if ENV['CI'] && !ENV['RAILS_ENABLE_TEST_LOG']
|
2017-07-20 04:39:21 -04:00
|
|
|
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(nil))
|
2017-07-13 10:51:37 -04:00
|
|
|
config.log_level = :fatal
|
|
|
|
end
|
2011-10-08 17:36:38 -04:00
|
|
|
end
|