aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-09-09 21:14:43 +0000
committerJamis Buck <jamis@37signals.com>2006-09-09 21:14:43 +0000
commit4d9ca4d9fbed86936b6a2cee792ea8509eef81b2 (patch)
tree261410c00df8de487b3fa3916a8f93720ad85df0 /actionmailer/test
parent3e7aa0391fb0da5ea6c38ceb682c8634d3a1cb72 (diff)
downloadrails-4d9ca4d9fbed86936b6a2cee792ea8509eef81b2.tar.gz
rails-4d9ca4d9fbed86936b6a2cee792ea8509eef81b2.tar.bz2
rails-4d9ca4d9fbed86936b6a2cee792ea8509eef81b2.zip
Make sure quoted-printable text is decoded correctly when only portions of the text are encoded. closes #3154.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5080 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/fixtures/raw_email_with_partially_quoted_subject14
-rw-r--r--actionmailer/test/quoting_test.rb7
2 files changed, 20 insertions, 1 deletions
diff --git a/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject b/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject
new file mode 100644
index 0000000000..e86108da1e
--- /dev/null
+++ b/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject
@@ -0,0 +1,14 @@
+From jamis@37signals.com Mon May 2 16:07:05 2005
+Mime-Version: 1.0 (Apple Message framework v622)
+Content-Transfer-Encoding: base64
+Message-Id: <d3b8cf8e49f04480850c28713a1f473e@37signals.com>
+Content-Type: text/plain;
+ charset=EUC-KR;
+ format=flowed
+To: jamis@37signals.com
+From: Jamis Buck <jamis@37signals.com>
+Subject: Re: Test: =?UTF-8?B?Iua8ouWtlyI=?= mid =?UTF-8?B?Iua8ouWtlyI=?= tail
+Date: Mon, 2 May 2005 16:07:05 -0600
+
+tOu6zrrQwMcguLbC+bChwfa3ziwgv+y4rrTCIMfPs6q01MC7ILnPvcC0z7TZLg0KDQrBpiDAzLin
+wLogSmFtaXPA1LTPtNku
diff --git a/actionmailer/test/quoting_test.rb b/actionmailer/test/quoting_test.rb
index 41d4ab680b..77bd769be9 100644
--- a/actionmailer/test/quoting_test.rb
+++ b/actionmailer/test/quoting_test.rb
@@ -26,6 +26,11 @@ class QuotingTest < Test::Unit::TestCase
assert_match %r{Elapsed time}, mail.body
end
+ def test_email_with_partially_quoted_subject
+ mail = TMail::Mail.parse(IO.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_partially_quoted_subject"))
+ assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject
+ end
+
private
# This whole thing *could* be much simpler, but I don't think Tempfile,
@@ -44,7 +49,7 @@ class QuotingTest < Test::Unit::TestCase
end
system("ruby #{test_name} > #{res_name}") or raise "could not run test in sandbox"
- File.read(res_name)
+ File.read(res_name).chomp
ensure
File.delete(test_name) rescue nil
File.delete(res_name) rescue nil