aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/abstract_unit.rb20
-rwxr-xr-xactionmailer/test/mail_service_test.rb22
-rw-r--r--actionmailer/test/url_test.rb24
3 files changed, 23 insertions, 43 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index 75690b49ad..8a30e39a2b 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -8,3 +8,23 @@ ActiveSupport::Deprecation.debug = true
$:.unshift "#{File.dirname(__FILE__)}/fixtures/helpers"
ActionMailer::Base.template_root = "#{File.dirname(__FILE__)}/fixtures"
+
+class MockSMTP
+ def self.deliveries
+ @@deliveries
+ end
+
+ def initialize
+ @@deliveries = []
+ end
+
+ def sendmail(mail, from, to)
+ @@deliveries << [mail, from, to]
+ end
+end
+
+class Net::SMTP
+ def self.start(*args)
+ yield MockSMTP.new
+ end
+end
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index 544413b328..ccded61b7c 100755
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -1,25 +1,5 @@
require "#{File.dirname(__FILE__)}/abstract_unit"
-class MockSMTP
- def self.deliveries
- @@deliveries
- end
-
- def initialize
- @@deliveries = []
- end
-
- def sendmail(mail, from, to)
- @@deliveries << [mail, from, to]
- end
-end
-
-class Net::SMTP
- def self.start(*args)
- yield MockSMTP.new
- end
-end
-
class FunkyPathMailer < ActionMailer::Base
self.template_root = "#{File.dirname(__FILE__)}/fixtures/path.with.dots"
@@ -274,6 +254,7 @@ class ActionMailerTest < Test::Unit::TestCase
def new_mail( charset="utf-8" )
mail = TMail::Mail.new
+ mail.mime_version = "1.0"
if charset
mail.set_content_type "text", "plain", { "charset" => charset }
end
@@ -315,7 +296,6 @@ class ActionMailerTest < Test::Unit::TestCase
expected.body = "Hello there, \n\nMr. #{@recipient}"
expected.from = "system@loudthinking.com"
expected.date = Time.local(2004, 12, 12)
- expected.mime_version = nil
created = nil
assert_nothing_raised { created = TestMailer.create_signed_up(@recipient) }
diff --git a/actionmailer/test/url_test.rb b/actionmailer/test/url_test.rb
index b953154515..ded343cfc5 100644
--- a/actionmailer/test/url_test.rb
+++ b/actionmailer/test/url_test.rb
@@ -1,25 +1,5 @@
require "#{File.dirname(__FILE__)}/abstract_unit"
-class MockSMTP
- def self.deliveries
- @@deliveries
- end
-
- def initialize
- @@deliveries = []
- end
-
- def sendmail(mail, from, to)
- @@deliveries << [mail, from, to]
- end
-end
-
-class Net::SMTP
- def self.start(*args)
- yield MockSMTP.new
- end
-end
-
class TestMailer < ActionMailer::Base
def signed_up_with_url(recipient)
@recipients = recipient
@@ -40,7 +20,7 @@ class TestMailer < ActionMailer::Base
end
end
-class ActionMailerTest < Test::Unit::TestCase
+class ActionMailerUrlTest < Test::Unit::TestCase
include ActionMailer::Quoting
def encode( text, charset="utf-8" )
@@ -49,6 +29,7 @@ class ActionMailerTest < Test::Unit::TestCase
def new_mail( charset="utf-8" )
mail = TMail::Mail.new
+ mail.mime_version = "1.0"
if charset
mail.set_content_type "text", "plain", { "charset" => charset }
end
@@ -74,7 +55,6 @@ class ActionMailerTest < Test::Unit::TestCase
expected.body = "Hello there, \n\nMr. #{@recipient}. Please see our greeting at http://example.com/welcome/greeting"
expected.from = "system@loudthinking.com"
expected.date = Time.local(2004, 12, 12)
- expected.mime_version = nil
created = nil
assert_nothing_raised { created = TestMailer.create_signed_up_with_url(@recipient) }