osem-fcy/config/environments/test.rb

60 lines
2.4 KiB
Ruby
Raw Normal View History

require 'active_support/core_ext/integer/time'
2013-01-07 09:04:09 +01: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
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
# 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
config.cache_store = :null_store
2013-01-07 09:04:09 +01:00
# Raise exceptions instead of rendering exception templates.
2013-01-07 09:04:09 +01:00
config.action_dispatch.show_exceptions = false
# 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
# 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 = []
# 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
config.after_initialize do
# 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)
end
2013-01-07 09:04:09 +01:00
end