Skip to content

Commit 23399b2

Browse files
authored
Merge pull request rails#50004 from seanpdoyle/action-mailer-bug-report-template
Add `actionmailer` bug report template
2 parents fd20970 + 8c59387 commit 23399b2

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# frozen_string_literal: true
2+
3+
require "bundler/inline"
4+
5+
gemfile(true) do
6+
source "https://rubygems.org"
7+
8+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
9+
10+
# Activate the gem you are reporting the issue against.
11+
gem "rails", "~> 7.1.0"
12+
end
13+
14+
require "action_mailer/railtie"
15+
16+
class TestMailer < ActionMailer::Base
17+
def hello_world
18+
@message = "Hello, world"
19+
20+
mail from: "[email protected]", to: "[email protected]" do |format|
21+
format.html { render inline: "<h1><%= @message %></h1>" }
22+
format.text { render inline: "<%= @message %>" }
23+
end
24+
end
25+
end
26+
27+
require "minitest/autorun"
28+
29+
class BugTest < ActionMailer::TestCase
30+
test "renders HTML and Text body" do
31+
email = TestMailer.hello_world
32+
33+
email.deliver_now
34+
35+
assert_dom_email do
36+
assert_dom "h1", text: "Hello, world"
37+
end
38+
assert_includes email.text_part.body, "Hello, world"
39+
end
40+
end
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# frozen_string_literal: true
2+
3+
require "bundler/inline"
4+
5+
gemfile(true) do
6+
source "https://rubygems.org"
7+
8+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
9+
10+
gem "rails", github: "rails/rails", branch: "main"
11+
end
12+
13+
require "action_mailer/railtie"
14+
15+
class TestMailer < ActionMailer::Base
16+
def hello_world
17+
@message = "Hello, world"
18+
19+
mail from: "[email protected]", to: "[email protected]" do |format|
20+
format.html { render inline: "<h1><%= @message %></h1>" }
21+
format.text { render inline: "<%= @message %>" }
22+
end
23+
end
24+
end
25+
26+
require "minitest/autorun"
27+
28+
class BugTest < ActionMailer::TestCase
29+
test "renders HTML and Text body" do
30+
email = TestMailer.hello_world
31+
32+
email.deliver_now
33+
34+
assert_dom_email do
35+
assert_dom "h1", text: "Hello, world"
36+
end
37+
assert_includes email.text_part.body, "Hello, world"
38+
end
39+
end

guides/source/contributing_to_ruby_on_rails.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Having a way to reproduce your issue will help people confirm, investigate, and
4444
* Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_main.rb)
4545
* Template for Active Job issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_main.rb)
4646
* Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_main.rb)
47+
* Template for Action Mailer issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailer_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailer_main.rb)
4748
* Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_main.rb)
4849
* Generic template for other issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_main.rb)
4950

0 commit comments

Comments
 (0)