1 # The test environment is used exclusively to run your application's
 
   2 # test suite. You never need to work with it otherwise. Remember that
 
   3 # your test database is "scratch space" for the test suite and is wiped
 
   4 # and recreated between test runs. Don't rely on the data there!
 
   6 Rails.application.configure do
 
   7   # Settings specified here will take precedence over those in config/application.rb.
 
   9   # While tests run files are not watched, reloading is not necessary.
 
  10   config.enable_reloading = false
 
  12   # Eager loading loads your entire application. When running a single test locally,
 
  13   # this is usually not necessary, and can slow down your test suite. However, it's
 
  14   # recommended that you enable it in continuous integration systems to ensure eager
 
  15   # loading is working properly before deploying your code.
 
  16   config.eager_load = ENV["CI"].present?
 
  18   # Configure public file server for tests with cache-control for performance.
 
  19   config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
 
  21   # Show full error reports.
 
  22   config.consider_all_requests_local = true
 
  23   config.cache_store = :null_store
 
  25   # Render exception templates for rescuable exceptions and raise for other exceptions.
 
  26   config.action_dispatch.show_exceptions = :rescuable
 
  28   # Disable request forgery protection in test environment.
 
  29   config.action_controller.allow_forgery_protection = false
 
  31   # Store uploaded files on the local file system in a temporary directory.
 
  32   config.active_storage.service = :test
 
  34   # Disable logging in tests, for speed increases. Set to :info to bring back logging
 
  35   config.log_level = :warn
 
  37   # Tell Action Mailer not to deliver emails to the real world.
 
  38   # The :test delivery method accumulates sent emails in the
 
  39   # ActionMailer::Base.deliveries array.
 
  40   config.action_mailer.delivery_method = :test
 
  42   # Set host to be used by links generated in mailer templates.
 
  43   config.action_mailer.default_url_options = { :host => Settings.server_url }
 
  45   # Print deprecation notices to the stderr.
 
  46   config.active_support.deprecation = :stderr
 
  48   # Raise exceptions for disallowed deprecations.
 
  49   config.active_support.disallowed_deprecation = :raise
 
  51   # Tell Active Support which deprecation messages to disallow.
 
  52   config.active_support.disallowed_deprecation_warnings = []
 
  54   # Raises error for missing translations.
 
  55   config.i18n.raise_on_missing_translations = true
 
  57   # Annotate rendered view with file names.
 
  58   # config.action_view.annotate_rendered_view_with_filenames = true
 
  60   # Raise error when a before_action's only/except options reference missing actions.
 
  61   config.action_controller.raise_on_missing_callback_actions = true
 
  63   # Use the test adapter for ActiveJob during testing.
 
  64   config.active_job.queue_adapter = :test
 
  66   # Allow FactoryBot to set primary key attributes.
 
  67   config.factory_bot.reject_primary_key_attributes = false
 
  69   # Disable page caching.
 
  70   config.action_controller.perform_caching = false