From 418639b4cfe477d7309fa53e8b8e2472b44bda80 Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Thu, 17 Dec 2009 12:00:32 +1100 Subject: Fixes for working with 1.9.1-head --- actionmailer/lib/action_mailer.rb | 2 +- actionmailer/lib/action_mailer/base.rb | 1 - actionmailer/lib/action_mailer/mail_helper.rb | 19 ------------------- actionmailer/test/mail_service_test.rb | 4 ++-- actionmailer/test/url_test.rb | 8 +++++++- 5 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 actionmailer/lib/action_mailer/mail_helper.rb (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer.rb b/actionmailer/lib/action_mailer.rb index e7ad68e212..e8adbf0eff 100644 --- a/actionmailer/lib/action_mailer.rb +++ b/actionmailer/lib/action_mailer.rb @@ -54,5 +54,5 @@ module Net end -gem 'mail', '>= 1.3.0' +gem 'mail', '>= 1.3.2' require 'mail' diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 24064b3a74..ab00bbba3c 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -258,7 +258,6 @@ module ActionMailer #:nodoc: include AbstractController::Layouts include AbstractController::Helpers - helper ActionMailer::MailHelper if Object.const_defined?(:ActionController) include ActionController::UrlWriter diff --git a/actionmailer/lib/action_mailer/mail_helper.rb b/actionmailer/lib/action_mailer/mail_helper.rb deleted file mode 100644 index 9aa178cdef..0000000000 --- a/actionmailer/lib/action_mailer/mail_helper.rb +++ /dev/null @@ -1,19 +0,0 @@ -module ActionMailer - module MailHelper - # Uses Text::Format to take the text and format it, indented two spaces for - # each line, and wrapped at 72 columns. - def block_format(text) - formatted = text.split(/\n\r\n/).collect { |paragraph| - Text::Format.new( - :columns => 72, :first_indent => 2, :body_indent => 2, :text => paragraph - ).format - }.join("\n") - - # Make list points stand on their own line - formatted.gsub!(/[ ]*([*]+) ([^*]*)/) { |s| " #{$1} #{$2.strip}\n" } - formatted.gsub!(/[ ]*([#]+) ([^#]*)/) { |s| " #{$1} #{$2.strip}\n" } - - formatted - end - end -end \ No newline at end of file diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index dd8307a834..122c20a308 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -534,7 +534,7 @@ class ActionMailerTest < Test::Unit::TestCase assert_not_nil mail mail, from, to = mail - assert_equal 'system@loudthinking.com', from.to_s + assert_equal 'system@loudthinking.com', from.decoded end def test_from_with_name_for_smtp @@ -545,7 +545,7 @@ class ActionMailerTest < Test::Unit::TestCase assert_not_nil mail mail, from, to = mail - assert_equal 'system@loudthinking.com', from.to_s + assert_equal 'system@loudthinking.com', from.addresses.first end def test_reply_to diff --git a/actionmailer/test/url_test.rb b/actionmailer/test/url_test.rb index 0e565b95e8..6334466a92 100644 --- a/actionmailer/test/url_test.rb +++ b/actionmailer/test/url_test.rb @@ -69,10 +69,16 @@ class ActionMailerUrlTest < Test::Unit::TestCase created = nil assert_nothing_raised { created = TestMailer.create_signed_up_with_url(@recipient) } assert_not_nil created + + expected.message_id = '<123@456>' + created.message_id = '<123@456>' assert_equal expected.encoded, created.encoded assert_nothing_raised { TestMailer.deliver_signed_up_with_url(@recipient) } assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded + delivered = ActionMailer::Base.deliveries.first + + delivered.message_id = '<123@456>' + assert_equal expected.encoded, delivered.encoded end end -- cgit v1.2.3