aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2009-12-27 18:38:30 +1100
committerMikel Lindsaar <raasdnil@gmail.com>2009-12-27 18:38:30 +1100
commit4e1fa4912d2777cba980b4a936a89bd63d201614 (patch)
tree5920ac3a7a39dd76d241b158bc077fb0f5479594
parent8950346f8a043b5bf4dde39e527270909bf2668c (diff)
downloadrails-4e1fa4912d2777cba980b4a936a89bd63d201614.tar.gz
rails-4e1fa4912d2777cba980b4a936a89bd63d201614.tar.bz2
rails-4e1fa4912d2777cba980b4a936a89bd63d201614.zip
Updating actionmailer to call :to_s on all field values instead of decoded
-rw-r--r--actionmailer/lib/action_mailer.rb2
-rw-r--r--actionmailer/test/mail_service_test.rb16
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 @@ class ActionMailerTest < Test::Unit::TestCase
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 @@ class ActionMailerTest < Test::Unit::TestCase
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 @@ class ActionMailerTest < Test::Unit::TestCase
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 @@ Content-Type: text/plain; charset=iso-8859-1
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 @@ Content-Type: text/plain; charset=iso-8859-1
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 @@ EOF
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 @@ EOF
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