aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-01-29 02:25:15 +0000
committerJamis Buck <jamis@37signals.com>2006-01-29 02:25:15 +0000
commit34df9be0e5bfcae1c84d1598bbcc3679314eca28 (patch)
tree00129e14b896636253e9d90f7e48d4d5b1c5857e /actionmailer/test
parent01b1a8772928fbf31180341356981b95d0581413 (diff)
downloadrails-34df9be0e5bfcae1c84d1598bbcc3679314eca28.tar.gz
rails-34df9be0e5bfcae1c84d1598bbcc3679314eca28.tar.bz2
rails-34df9be0e5bfcae1c84d1598bbcc3679314eca28.zip
Template paths with dot chars in them no longer mess up implicit template selection for multipart messages (closes #3332)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3495 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml1
-rwxr-xr-xactionmailer/test/mail_service_test.rb21
2 files changed, 21 insertions, 1 deletions
diff --git a/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml b/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml
new file mode 100644
index 0000000000..897a5065cf
--- /dev/null
+++ b/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml
@@ -0,0 +1 @@
+Have a lovely picture, from me. Enjoy! \ No newline at end of file
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index 4d569da31f..838c49b7c3 100755
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -23,6 +23,20 @@ class Net::SMTP
end
end
+class FunkyPathMailer < ActionMailer::Base
+ def multipart_with_template_path_with_dots(recipient)
+ recipients recipient
+ subject "Have a lovely picture"
+ from "Chad Fowler <chad@chadfowler.com>"
+ attachment :content_type => "image/jpeg",
+ :body => "not really a jpeg, we're only testing, after all"
+ end
+
+ def template_path
+ "#{File.dirname(__FILE__)}/fixtures/path.with.dots"
+ end
+end
+
class TestMailer < ActionMailer::Base
def signed_up(recipient)
@@ -748,9 +762,14 @@ EOF
end
def test_deliver_with_mail_object
- mail = TestMailer::create_headers_with_nonalpha_chars(@recipient)
+ mail = TestMailer.create_headers_with_nonalpha_chars(@recipient)
assert_nothing_raised { TestMailer.deliver(mail) }
assert_equal 1, TestMailer.deliveries.length
end
+
+ def test_multipart_with_template_path_with_dots
+ mail = FunkyPathMailer.create_multipart_with_template_path_with_dots(@recipient)
+ assert_equal 2, mail.parts.length
+ end
end