From 4e1fa4912d2777cba980b4a936a89bd63d201614 Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Sun, 27 Dec 2009 18:38:30 +1100 Subject: [PATCH] Updating actionmailer to call :to_s on all field values instead of decoded --- actionmailer/lib/action_mailer.rb | 2 +- actionmailer/test/mail_service_test.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actionmailer/lib/action_mailer.rb b/actionmailer/lib/action_mailer.rb index 87e1c4a1f3..c82efe4d6d 100644 --- a/actionmailer/lib/action_mailer.rb +++ b/actionmailer/lib/action_mailer.rb @@ -55,5 +55,5 @@ module Net end -gem 'mail', '>= 1.3.4' +gem 'mail', '>= 1.3.5' require 'mail' diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 122c20a308..3e65c0b012 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -363,7 +363,7 @@ def test_nested_parts assert_equal "multipart/mixed", created.content_type.string assert_equal "multipart/alternative", created.parts[0].content_type.string - assert_equal "bar", created.parts[0].header['foo'].decoded + assert_equal "bar", created.parts[0].header['foo'].to_s assert_nil created.parts[0].charset assert_equal "text/plain", created.parts[0].parts[0].content_type.string assert_equal "text/html", created.parts[0].parts[1].content_type.string @@ -425,11 +425,11 @@ def test_signed_up def test_subject_with_i18n assert_nothing_raised { TestMailer.deliver_subject_with_i18n(@recipient) } - assert_equal "Subject with i18n", ActionMailer::Base.deliveries.first.subject.decoded + assert_equal "Subject with i18n", ActionMailer::Base.deliveries.first.subject.to_s I18n.backend.store_translations('en', :actionmailer => {:test_mailer => {:subject_with_i18n => {:subject => "New Subject!"}}}) assert_nothing_raised { TestMailer.deliver_subject_with_i18n(@recipient) } - assert_equal "New Subject!", ActionMailer::Base.deliveries.last.subject.decoded + assert_equal "New Subject!", ActionMailer::Base.deliveries.last.subject.to_s end def test_custom_template @@ -534,7 +534,7 @@ def test_from_without_name_for_smtp assert_not_nil mail mail, from, to = mail - assert_equal 'system@loudthinking.com', from.decoded + assert_equal 'system@loudthinking.com', from.to_s end def test_from_with_name_for_smtp @@ -730,7 +730,7 @@ def test_unquote_quoted_printable_subject The body EOF mail = Mail.new(msg) - assert_equal "testing testing \326\244", mail.subject.decoded + assert_equal "testing testing \326\244", mail.subject.to_s assert_equal "Subject: =?utf-8?Q?testing_testing_=D6=A4?=\r\n", mail.subject.encoded end @@ -743,7 +743,7 @@ def test_unquote_7bit_subject The body EOF mail = Mail.new(msg) - assert_equal "this == working?", mail.subject.decoded + assert_equal "this == working?", mail.subject.to_s assert_equal "Subject: this == working?\r\n", mail.subject.encoded end @@ -960,7 +960,7 @@ def test_implicitly_multipart_messages mail = TestMailer.create_implicitly_multipart_example(@recipient) assert_equal 3, mail.parts.length - assert_equal "1.0", mail.mime_version.decoded + assert_equal "1.0", mail.mime_version.to_s assert_equal "multipart/alternative", mail.content_type.string assert_equal "application/x-yaml", mail.parts[0].content_type.string assert_equal "utf-8", mail.parts[0].charset @@ -1108,7 +1108,7 @@ def test_custom_content_type_attributes def test_return_path_with_create mail = TestMailer.create_return_path - assert_equal "another@somewhere.test", mail['return-path'].decoded.to_s + assert_equal "another@somewhere.test", mail['return-path'].to_s end def test_return_path_with_deliver -- GitLab