Fixes for working with 1.9.1-head

This commit is contained in:
Mikel Lindsaar
2009-12-17 12:00:32 +11:00
parent 186cd7bc53
commit 418639b4cf
5 changed files with 10 additions and 24 deletions

View File

@@ -54,5 +54,5 @@ module Net
end
gem 'mail', '>= 1.3.0'
gem 'mail', '>= 1.3.2'
require 'mail'

View File

@@ -258,7 +258,6 @@ module ActionMailer #:nodoc:
include AbstractController::Layouts
include AbstractController::Helpers
helper ActionMailer::MailHelper
if Object.const_defined?(:ActionController)
include ActionController::UrlWriter

View File

@@ -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

View File

@@ -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

View File

@@ -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