rubygem-actionmailer/backport-CVE-2024-47889-test.patch
starlet-dx a8fe0578d7 Fix CVE-2024-47889
(cherry picked from commit 7c1fa60bfff86dd8054f38cb35ac4a2b94fef4d4)
2024-10-17 20:33:42 +08:00

22 lines
792 B
Diff

diff --git a/actionmailer/test/mail_helper_test.rb b/actionmailer/test/mail_helper_test.rb
index a8ab19a95c0e3..e49eabdce8275 100644
--- a/actionmailer/test/mail_helper_test.rb
+++ b/actionmailer/test/mail_helper_test.rb
@@ -121,4 +121,16 @@ def test_use_cache
assert_equal "Greetings from a cache helper block", mail.body.encoded
end
end
+
+ def helper
+ Object.new.extend(ActionMailer::MailHelper)
+ end
+
+ def test_block_format
+ assert_equal " * foo\n", helper.block_format(" * foo")
+ assert_equal " * foo\n", helper.block_format(" * foo")
+ assert_equal " * foo\n", helper.block_format("* foo")
+ assert_equal " * foo\n*bar", helper.block_format("* foo*bar")
+ assert_equal " * foo\n * bar\n", helper.block_format("* foo * bar")
+ end
end