]> git.openstreetmap.org Git - rails.git/blob - config/environments/test.rb
Merge pull request #6394 from openstreetmap/dependabot/github_actions/ruby/setup...
[rails.git] / config / environments / test.rb
1 # frozen_string_literal: true
2
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!
7
8 Rails.application.configure do
9   # Settings specified here will take precedence over those in config/application.rb.
10
11   # While tests run files are not watched, reloading is not necessary.
12   config.enable_reloading = false
13
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?
19
20   # Configure public file server for tests with cache-control for performance.
21   config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
22
23   # Show full error reports.
24   config.consider_all_requests_local = true
25   config.cache_store = :null_store
26
27   # Render exception templates for rescuable exceptions and raise for other exceptions.
28   config.action_dispatch.show_exceptions = :rescuable
29
30   # Disable request forgery protection in test environment.
31   config.action_controller.allow_forgery_protection = false
32
33   # Store uploaded files on the local file system in a temporary directory.
34   config.active_storage.service = :test
35
36   # Disable logging in tests, for speed increases. Set to :info to bring back logging
37   config.log_level = :warn
38
39   # Tell Action Mailer not to deliver emails to the real world.
40   # The :test delivery method accumulates sent emails in the
41   # ActionMailer::Base.deliveries array.
42   config.action_mailer.delivery_method = :test
43
44   # Set host to be used by links generated in mailer templates.
45   config.action_mailer.default_url_options = { :host => Settings.server_url }
46
47   # Print deprecation notices to the stderr.
48   config.active_support.deprecation = :stderr
49
50   # Raise exceptions for disallowed deprecations.
51   config.active_support.disallowed_deprecation = :raise
52
53   # Tell Active Support which deprecation messages to disallow.
54   config.active_support.disallowed_deprecation_warnings = []
55
56   # Raises error for missing translations.
57   config.i18n.raise_on_missing_translations = true
58
59   # Annotate rendered view with file names.
60   # config.action_view.annotate_rendered_view_with_filenames = true
61
62   # Raise error when a before_action's only/except options reference missing actions.
63   config.action_controller.raise_on_missing_callback_actions = true
64
65   # Use the test adapter for ActiveJob during testing.
66   config.active_job.queue_adapter = :test
67
68   # Allow FactoryBot to set primary key attributes.
69   config.factory_bot.reject_primary_key_attributes = false
70
71   # Disable page caching.
72   config.action_controller.perform_caching = false
73 end