Skip to content

Commit 723d5fd

Browse files
committed
Set framework_defaults in Active Job and Action Mailer bug report templates
Follow up to commit 0fedf12 which missed the Active Job and Action Mailer templates. When testing bugs using the bug report templates, it helps if the correct framework defaults are enabled for all templates. This makes sure the scripts behave more inline with a regular Rails application and allows easily testing older defaults.
1 parent 042e392 commit 723d5fd

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

guides/bug_report_templates/action_mailer.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
require "action_mailer/railtie"
1414
require "minitest/autorun"
1515

16+
class TestApp < Rails::Application
17+
config.load_defaults Rails::VERSION::STRING.to_f
18+
config.root = __dir__
19+
config.eager_load = false
20+
config.hosts << "example.org"
21+
config.secret_key_base = "secret_key_base"
22+
23+
config.logger = Logger.new($stdout)
24+
end
25+
Rails.application.initialize!
26+
1627
class TestMailer < ActionMailer::Base
1728
def hello_world
1829
@message = "Hello, world"

guides/bug_report_templates/active_job.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,18 @@
1010
# gem "rails", github: "rails/rails", branch: "main"
1111
end
1212

13-
require "active_job"
13+
require "active_job/railtie"
1414
require "minitest/autorun"
1515

16+
class TestApp < Rails::Application
17+
config.load_defaults Rails::VERSION::STRING.to_f
18+
config.eager_load = false
19+
config.secret_key_base = "secret_key_base"
20+
21+
config.logger = Logger.new($stdout)
22+
end
23+
Rails.application.initialize!
24+
1625
class BuggyJob < ActiveJob::Base
1726
def perform
1827
puts "performed"

0 commit comments

Comments
 (0)