aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/old_base/mail_layout_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-26 09:27:21 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-26 09:27:54 -0600
commit9f7190187cd755345557009a0b0ca9eec679b415 (patch)
treeada1fb1c4a11e3336b626b9754a280c8aa0d91bb /actionmailer/test/old_base/mail_layout_test.rb
parent52bb455c0d2d9ad6acc16d4679365d01723f6222 (diff)
downloadrails-9f7190187cd755345557009a0b0ca9eec679b415.tar.gz
rails-9f7190187cd755345557009a0b0ca9eec679b415.tar.bz2
rails-9f7190187cd755345557009a0b0ca9eec679b415.zip
Failing AM test for nested layouts
Diffstat (limited to 'actionmailer/test/old_base/mail_layout_test.rb')
-rw-r--r--actionmailer/test/old_base/mail_layout_test.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/actionmailer/test/old_base/mail_layout_test.rb b/actionmailer/test/old_base/mail_layout_test.rb
index 4038fbf339..2abd3ece92 100644
--- a/actionmailer/test/old_base/mail_layout_test.rb
+++ b/actionmailer/test/old_base/mail_layout_test.rb
@@ -1,7 +1,7 @@
require 'abstract_unit'
class AutoLayoutMailer < ActionMailer::Base
-
+
def hello
recipients 'test@localhost'
subject "You have a mail"
@@ -51,6 +51,16 @@ class ExplicitLayoutMailer < ActionMailer::Base
end
end
+class NestedLayoutMailer < ActionMailer::Base
+ layout 'nested/layouts/spam'
+
+ def signup
+ recipients 'test@localhost'
+ subject "You have a mail"
+ from "tester@example.com"
+ end
+end
+
class LayoutMailerTest < Test::Unit::TestCase
def setup
set_delivery_method :test
@@ -77,7 +87,7 @@ class LayoutMailerTest < Test::Unit::TestCase
# CHANGED: content_type returns an object
# assert_equal 'text/plain', mail.parts.first.content_type
assert_equal 'text/plain', mail.parts.first.mime_type
-
+
# CHANGED: body returns an object
# assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body
assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body.to_s
@@ -145,4 +155,9 @@ class LayoutMailerTest < Test::Unit::TestCase
mail = ExplicitLayoutMailer.logout
assert_equal "You logged out", mail.body.to_s.strip
end
+
+ def test_nested_class_layout
+ mail = NestedLayoutMailer.signup
+ assert_equal "Nested Spammer layout We do not spam", mail.body.to_s.strip
+ end
end