2021-08-17 14:58:06 +02:00
|
|
|
require 'active_support/core_ext/integer/time'
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2021-08-17 14:58:06 +02:00
|
|
|
# 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!
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2021-08-17 14:58:06 +02:00
|
|
|
Rails.application.configure do
|
|
|
|
|
# Settings specified here will take precedence over those in config/application.rb.
|
|
|
|
|
|
2022-02-10 17:41:08 +01:00
|
|
|
# Turn false under Spring and add config.action_view.cache_template_loading = true.
|
|
|
|
|
config.cache_classes = true
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2022-02-10 17:41:08 +01:00
|
|
|
# Eager loading loads your whole application. When running a single test locally,
|
|
|
|
|
# this probably isn't necessary. It's a good idea to do in a continuous integration
|
|
|
|
|
# system, or in some way before deploying your code.
|
|
|
|
|
config.eager_load = ENV['CI'].present?
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2021-08-17 14:58:06 +02: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.to_i}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show full error reports and disable caching.
|
2013-01-07 09:04:09 +01:00
|
|
|
config.consider_all_requests_local = true
|
|
|
|
|
config.action_controller.perform_caching = false
|
2022-02-10 17:41:08 +01:00
|
|
|
config.action_mailer.perform_caching = false
|
2021-08-17 14:58:06 +02:00
|
|
|
config.cache_store = :null_store
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2021-08-17 14:58:06 +02:00
|
|
|
# Raise exceptions instead of rendering exception templates.
|
2013-01-07 09:04:09 +01:00
|
|
|
config.action_dispatch.show_exceptions = false
|
|
|
|
|
|
2021-08-17 14:58:06 +02:00
|
|
|
# Disable request forgery protection in test environment.
|
|
|
|
|
config.action_controller.allow_forgery_protection = false
|
|
|
|
|
|
|
|
|
|
# Print deprecation notices to the stderr.
|
2013-01-07 09:04:09 +01:00
|
|
|
config.active_support.deprecation = :stderr
|
2014-06-11 09:31:13 +02:00
|
|
|
|
2021-08-17 14:58:06 +02:00
|
|
|
# Raise exceptions for disallowed deprecations.
|
|
|
|
|
config.active_support.disallowed_deprecation = :raise
|
|
|
|
|
|
|
|
|
|
# Tell Active Support which deprecation messages to disallow.
|
|
|
|
|
config.active_support.disallowed_deprecation_warnings = []
|
|
|
|
|
|
2022-10-27 12:54:35 -07:00
|
|
|
# Provide a default host for URLs
|
|
|
|
|
Rails.application.routes.default_url_options[:host] = 'localhost:3000'
|
|
|
|
|
config.action_controller.default_url_options = Rails.application.routes.default_url_options
|
|
|
|
|
config.action_mailer.default_url_options = Rails.application.routes.default_url_options
|
|
|
|
|
|
|
|
|
|
# Configure outgoing mail
|
2022-02-10 17:41:08 +01:00
|
|
|
config.action_mailer.delivery_method = :test
|
2016-03-23 11:49:30 +01:00
|
|
|
|
2014-07-04 22:38:47 +02:00
|
|
|
config.after_initialize do
|
2014-07-23 09:08:50 +02:00
|
|
|
# Set Time.now to May 1, 2014 00:01:00 AM (at this instant), but allow it to move forward
|
|
|
|
|
t = Time.local(2014, 05, 01, 00, 01, 00)
|
|
|
|
|
Timecop.travel(t)
|
2014-07-04 22:38:47 +02:00
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|