aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-12-03 13:58:47 -0600
committerJoshua Peek <josh@joshpeek.com>2008-12-03 13:58:47 -0600
commit7c0dfa35dbcfdb60f4cbd07b55f194a04e1b48c1 (patch)
tree5b2706e2c4f1b09c27e8ff5e89910cad0709acba /actionmailer/test
parent761a633a9c0a45d76ef3ed10da97e3696c3ded79 (diff)
downloadrails-7c0dfa35dbcfdb60f4cbd07b55f194a04e1b48c1.tar.gz
rails-7c0dfa35dbcfdb60f4cbd07b55f194a04e1b48c1.tar.bz2
rails-7c0dfa35dbcfdb60f4cbd07b55f194a04e1b48c1.zip
Register bogus template handlers for ActionMailer test fixtures
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/abstract_unit.rb4
-rw-r--r--actionmailer/test/mail_service_test.rb6
2 files changed, 10 insertions, 0 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index 1617b88c8e..ad1eac912b 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -9,6 +9,10 @@ require 'action_mailer/test_case'
# Show backtraces for deprecated behavior for quicker cleanup.
ActiveSupport::Deprecation.debug = true
+# Bogus template processors
+ActionView::Template.register_template_handler :haml, lambda { |template| "Look its HAML!" }
+ActionView::Template.register_template_handler :bak, lambda { |template| "Lame backup" }
+
$:.unshift "#{File.dirname(__FILE__)}/fixtures/helpers"
ActionMailer::Base.template_root = "#{File.dirname(__FILE__)}/fixtures"
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index c49049cc6a..e469302fe1 100644
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -389,6 +389,8 @@ class ActionMailerTest < Test::Unit::TestCase
end
def test_custom_templating_extension
+ assert ActionView::Template.template_handler_extensions.include?("haml"), "haml extension was not registered"
+
# N.b., custom_templating_extension.text.plain.haml is expected to be in fixtures/test_mailer directory
expected = new_mail
expected.to = @recipient
@@ -799,6 +801,8 @@ EOF
end
def test_implicitly_multipart_messages
+ assert ActionView::Template.template_handler_extensions.include?("bak"), "bak extension was not registered"
+
mail = TestMailer.create_implicitly_multipart_example(@recipient)
assert_equal 3, mail.parts.length
assert_equal "1.0", mail.mime_version
@@ -812,6 +816,8 @@ EOF
end
def test_implicitly_multipart_messages_with_custom_order
+ assert ActionView::Template.template_handler_extensions.include?("bak"), "bak extension was not registered"
+
mail = TestMailer.create_implicitly_multipart_example(@recipient, nil, ["text/yaml", "text/plain"])
assert_equal 3, mail.parts.length
assert_equal "text/html", mail.parts[0].content_type