From 1cd55928c6f638affeb5d89293f478817675d7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim=20and=20Mikel=20Lindsaar?= Date: Fri, 22 Jan 2010 13:56:06 +0100 Subject: First work on implicit multipart. --- actionmailer/test/base_test.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'actionmailer/test/base_test.rb') diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index f22b20a6ba..8502b29ba4 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -62,6 +62,10 @@ class BaseTest < ActiveSupport::TestCase :transfer_encoding => "base64" } mail(DEFAULT_HEADERS) end + + def implicit_multipart + mail(DEFAULT_HEADERS) + end end test "method call to mail does not raise error" do @@ -156,7 +160,19 @@ class BaseTest < ActiveSupport::TestCase email = BaseMailer.deliver_welcome(:subject => nil) assert_equal "New Subject!", email.subject end - + + test "implicit multipart tests" do + require 'ruby-debug' + $BREAK = true + email = BaseMailer.deliver_implicit_multipart + + assert_equal(2, email.parts.size) + + assert_equal("multipart/alternate", email.mime_type) + assert_equal("text/plain", email.parts[0].mime_type) + assert_equal("text/html", email.parts[1].mime_type) + end + protected # Execute the block setting the given values and restoring old values after -- cgit v1.2.3