Mercurial > zeropaste
comparison config/environments/test.rb @ 495:92929378413e
Update to latest rails
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 15 Dec 2024 22:18:06 +0900 |
parents | 6cac8fcf8164 |
children |
comparison
equal
deleted
inserted
replaced
494:e508d3226214 | 495:92929378413e |
---|---|
1 require "active_support/core_ext/integer/time" | |
2 | |
3 # The test environment is used exclusively to run your application's | 1 # The test environment is used exclusively to run your application's |
4 # test suite. You never need to work with it otherwise. Remember that | 2 # 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 | 3 # 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! | 4 # and recreated between test runs. Don't rely on the data there! |
7 | 5 |
8 Rails.application.configure do | 6 Rails.application.configure do |
9 # Settings specified here will take precedence over those in config/application.rb. | 7 # Settings specified here will take precedence over those in config/application.rb. |
10 | 8 |
11 # Turn false under Spring and add config.action_view.cache_template_loading = true. | 9 # While tests run files are not watched, reloading is not necessary. |
12 config.cache_classes = true | 10 config.enable_reloading = false |
13 | 11 |
14 # Eager loading loads your whole application. When running a single test locally, | 12 # Eager loading loads your entire application. When running a single test locally, |
15 # this probably isn't necessary. It's a good idea to do in a continuous integration | 13 # this is usually not necessary, and can slow down your test suite. However, it's |
16 # system, or in some way before deploying your code. | 14 # recommended that you enable it in continuous integration systems to ensure eager |
15 # loading is working properly before deploying your code. | |
17 config.eager_load = ENV["CI"].present? | 16 config.eager_load = ENV["CI"].present? |
18 | 17 |
19 # Configure public file server for tests with Cache-Control for performance. | 18 # Configure public file server for tests with cache-control for performance. |
20 config.public_file_server.enabled = true | 19 config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } |
21 config.public_file_server.headers = { | |
22 "Cache-Control" => "public, max-age=#{1.hour.to_i}" | |
23 } | |
24 | 20 |
25 # Show full error reports and disable caching. | 21 # Show full error reports. |
26 config.consider_all_requests_local = true | 22 config.consider_all_requests_local = true |
27 config.action_controller.perform_caching = false | |
28 config.cache_store = :null_store | 23 config.cache_store = :null_store |
29 | 24 |
30 # Raise exceptions instead of rendering exception templates. | 25 # Render exception templates for rescuable exceptions and raise for other exceptions. |
31 config.action_dispatch.show_exceptions = false | 26 config.action_dispatch.show_exceptions = :rescuable |
32 | 27 |
33 # Disable request forgery protection in test environment. | 28 # Disable request forgery protection in test environment. |
34 config.action_controller.allow_forgery_protection = false | 29 config.action_controller.allow_forgery_protection = false |
35 | 30 |
36 # Print deprecation notices to the stderr. | 31 # Print deprecation notices to the stderr. |
37 config.active_support.deprecation = :stderr | 32 config.active_support.deprecation = :stderr |
38 | 33 |
39 # Raise exceptions for disallowed deprecations. | |
40 config.active_support.disallowed_deprecation = :raise | |
41 | |
42 # Tell Active Support which deprecation messages to disallow. | |
43 config.active_support.disallowed_deprecation_warnings = [] | |
44 | |
45 # Raises error for missing translations. | 34 # Raises error for missing translations. |
46 # config.i18n.raise_on_missing_translations = true | 35 # config.i18n.raise_on_missing_translations = true |
47 | 36 |
48 # Annotate rendered view with file names. | 37 # Annotate rendered view with file names. |
49 # config.action_view.annotate_rendered_view_with_filenames = true | 38 # config.action_view.annotate_rendered_view_with_filenames = true |
39 | |
40 # Raise error when a before_action's only/except options reference missing actions. | |
41 config.action_controller.raise_on_missing_callback_actions = true | |
50 end | 42 end |