1 require "active_support/core_ext/integer/time"
 
   3 # The test environment is used exclusively to run your application's
 
   4 # test suite. You never need to work with it otherwise. Remember that
 
   5 # your test database is "scratch space" for the test suite and is wiped
 
   6 # and recreated between test runs. Don't rely on the data there!
 
   8 Rails.application.configure do
 
   9   # Settings specified here will take precedence over those in config/application.rb.
 
  11   # While tests run files are not watched, reloading is not necessary.
 
  12   config.enable_reloading = false
 
  14   # Eager loading loads your entire application. When running a single test locally,
 
  15   # this is usually not necessary, and can slow down your test suite. However, it's
 
  16   # recommended that you enable it in continuous integration systems to ensure eager
 
  17   # loading is working properly before deploying your code.
 
  18   config.eager_load = ENV["CI"].present?
 
  20   # Configure public file server for tests with Cache-Control for performance.
 
  21   config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
 
  23   # Show full error reports and disable caching.
 
  24   config.consider_all_requests_local = true
 
  25   config.action_controller.perform_caching = false
 
  26   config.cache_store = :null_store
 
  28   # Render exception templates for rescuable exceptions and raise for other exceptions.
 
  29   config.action_dispatch.show_exceptions = :rescuable
 
  31   # Disable request forgery protection in test environment.
 
  32   config.action_controller.allow_forgery_protection = false
 
  34   # Store uploaded files on the local file system in a temporary directory.
 
  35   config.active_storage.service = :test
 
  37   # Disable logging in tests, for speed increases. Set to :info to bring back logging
 
  38   config.log_level = :warn
 
  40   # Disable caching for Action Mailer templates even if Action Controller
 
  42   config.action_mailer.perform_caching = false
 
  44   # Tell Action Mailer not to deliver emails to the real world.
 
  45   # The :test delivery method accumulates sent emails in the
 
  46   # ActionMailer::Base.deliveries array.
 
  47   config.action_mailer.delivery_method = :test
 
  49   # Unlike controllers, the mailer instance doesn't have any context about the
 
  50   # incoming request so you'll need to provide the :host parameter yourself.
 
  51   config.action_mailer.default_url_options = { :host => Settings.server_url }
 
  53   # Print deprecation notices to the stderr.
 
  54   config.active_support.deprecation = :stderr
 
  56   # Raise exceptions for disallowed deprecations.
 
  57   config.active_support.disallowed_deprecation = :raise
 
  59   # Tell Active Support which deprecation messages to disallow.
 
  60   config.active_support.disallowed_deprecation_warnings = []
 
  62   # Export translations automatically.
 
  63   config.middleware.use I18n::JS::Middleware
 
  65   # Raises error for missing translations.
 
  66   config.i18n.raise_on_missing_translations = true
 
  68   # Annotate rendered view with file names.
 
  69   # config.action_view.annotate_rendered_view_with_filenames = true
 
  71   # Raise error when a before_action's only/except options reference missing actions.
 
  72   config.action_controller.raise_on_missing_callback_actions = true
 
  74   # Use the test adapter for ActiveJob during testing.
 
  75   config.active_job.queue_adapter = :test
 
  77   # Allow FactoryBot to set primary key attributes
 
  78   config.factory_bot.reject_primary_key_attributes = false