aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorDamien Mathieu <42@dmathieu.com>2012-06-20 21:20:12 +0200
committerDamien Mathieu <42@dmathieu.com>2012-06-20 22:06:31 +0200
commit45b1045d16126e69ad5af395fa14d1291914a4d4 (patch)
tree94dab7b2af1ebd7e052c866236524d52adaff302 /actionmailer/test
parentb046ea452cdf08035d192d041250b436a3991af8 (diff)
downloadrails-45b1045d16126e69ad5af395fa14d1291914a4d4.tar.gz
rails-45b1045d16126e69ad5af395fa14d1291914a4d4.tar.bz2
rails-45b1045d16126e69ad5af395fa14d1291914a4d4.zip
raise an error if no implicit mailer template could be found
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/base_test.rb7
-rw-r--r--actionmailer/test/fixtures/base_mailer/attachment_with_hash.html.erb0
-rw-r--r--actionmailer/test/fixtures/base_mailer/attachment_with_hash_default_encoding.html.erb0
-rw-r--r--actionmailer/test/fixtures/base_mailer/welcome_with_headers.html.erb0
-rw-r--r--actionmailer/test/fixtures/base_test/after_filter_mailer/welcome.html.erb0
-rw-r--r--actionmailer/test/fixtures/base_test/before_filter_mailer/welcome.html.erb0
-rw-r--r--actionmailer/test/fixtures/base_test/default_inline_attachment_mailer/welcome.html.erb0
-rw-r--r--actionmailer/test/fixtures/mail_delivery_test/delivery_mailer/welcome.html.erb0
-rw-r--r--actionmailer/test/fixtures/proc_mailer/welcome.html.erb0
9 files changed, 7 insertions, 0 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index 1d747ed18a..1b2e39b3f7 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -433,6 +433,13 @@ class BaseTest < ActiveSupport::TestCase
assert_equal("TEXT Implicit Multipart", mail.text_part.body.decoded)
end
+ test "should raise if missing template in implicit render" do
+ assert_raises ActionView::MissingTemplate do
+ BaseMailer.implicit_different_template('missing_template').deliver
+ end
+ assert_equal(0, BaseMailer.deliveries.length)
+ end
+
test "you can specify a different template for explicit render" do
mail = BaseMailer.explicit_different_template('explicit_multipart_templates').deliver
assert_equal("HTML Explicit Multipart Templates", mail.html_part.body.decoded)
diff --git a/actionmailer/test/fixtures/base_mailer/attachment_with_hash.html.erb b/actionmailer/test/fixtures/base_mailer/attachment_with_hash.html.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionmailer/test/fixtures/base_mailer/attachment_with_hash.html.erb
diff --git a/actionmailer/test/fixtures/base_mailer/attachment_with_hash_default_encoding.html.erb b/actionmailer/test/fixtures/base_mailer/attachment_with_hash_default_encoding.html.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionmailer/test/fixtures/base_mailer/attachment_with_hash_default_encoding.html.erb
diff --git a/actionmailer/test/fixtures/base_mailer/welcome_with_headers.html.erb b/actionmailer/test/fixtures/base_mailer/welcome_with_headers.html.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionmailer/test/fixtures/base_mailer/welcome_with_headers.html.erb
diff --git a/actionmailer/test/fixtures/base_test/after_filter_mailer/welcome.html.erb b/actionmailer/test/fixtures/base_test/after_filter_mailer/welcome.html.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionmailer/test/fixtures/base_test/after_filter_mailer/welcome.html.erb
diff --git a/actionmailer/test/fixtures/base_test/before_filter_mailer/welcome.html.erb b/actionmailer/test/fixtures/base_test/before_filter_mailer/welcome.html.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionmailer/test/fixtures/base_test/before_filter_mailer/welcome.html.erb
diff --git a/actionmailer/test/fixtures/base_test/default_inline_attachment_mailer/welcome.html.erb b/actionmailer/test/fixtures/base_test/default_inline_attachment_mailer/welcome.html.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionmailer/test/fixtures/base_test/default_inline_attachment_mailer/welcome.html.erb
diff --git a/actionmailer/test/fixtures/mail_delivery_test/delivery_mailer/welcome.html.erb b/actionmailer/test/fixtures/mail_delivery_test/delivery_mailer/welcome.html.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionmailer/test/fixtures/mail_delivery_test/delivery_mailer/welcome.html.erb
diff --git a/actionmailer/test/fixtures/proc_mailer/welcome.html.erb b/actionmailer/test/fixtures/proc_mailer/welcome.html.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionmailer/test/fixtures/proc_mailer/welcome.html.erb