Skip to content

Commit 36156e7

Browse files
committed
Update for Rails 7.2: config/environments/test.rb
1 parent 62f9535 commit 36156e7

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

config/environments/test.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,35 @@
1818
config.eager_load = ENV["CI"].present?
1919

2020
# Configure public file server for tests with Cache-Control for performance.
21-
config.public_file_server.enabled = true
22-
config.public_file_server.headers = {
23-
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
24-
}
21+
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
2522

2623
# Show full error reports and disable caching.
2724
config.consider_all_requests_local = true
2825
config.action_controller.perform_caching = false
2926
config.cache_store = :null_store
3027

3128
# Render exception templates for rescuable exceptions and raise for other exceptions.
32-
config.action_dispatch.show_exceptions = :none
29+
config.action_dispatch.show_exceptions = :rescuable
3330

3431
# Disable request forgery protection in test environment.
3532
config.action_controller.allow_forgery_protection = false
3633

3734
# Store uploaded files on the local file system in a temporary directory.
3835
config.active_storage.service = :test
3936

37+
# Disable caching for Action Mailer templates even if Action Controller
38+
# caching is enabled.
4039
config.action_mailer.perform_caching = false
4140

4241
# Tell Action Mailer not to deliver emails to the real world.
4342
# The :test delivery method accumulates sent emails in the
4443
# ActionMailer::Base.deliveries array.
4544
config.action_mailer.delivery_method = :test
4645

46+
# Unlike controllers, the mailer instance doesn't have any context about the
47+
# incoming request so you'll need to provide the :host parameter yourself.
48+
config.action_mailer.default_url_options = { host: "coderdojo.jp" }
49+
4750
# Print deprecation notices to the stderr.
4851
config.active_support.deprecation = :stderr
4952

@@ -59,6 +62,6 @@
5962
# Annotate rendered view with file names.
6063
# config.action_view.annotate_rendered_view_with_filenames = true
6164

62-
# Raise error when a before_action's only/except options reference missing actions
65+
# Raise error when a before_action's only/except options reference missing actions.
6366
config.action_controller.raise_on_missing_callback_actions = true
6467
end

0 commit comments

Comments
 (0)