Failing AM test for nested layouts
This commit is contained in:
parent
52bb455c0d
commit
9f7190187c
|
@ -0,0 +1 @@
|
||||||
|
Nested Spammer layout <%= yield %>
|
|
@ -0,0 +1 @@
|
||||||
|
We do not spam
|
|
@ -1,7 +1,7 @@
|
||||||
require 'abstract_unit'
|
require 'abstract_unit'
|
||||||
|
|
||||||
class AutoLayoutMailer < ActionMailer::Base
|
class AutoLayoutMailer < ActionMailer::Base
|
||||||
|
|
||||||
def hello
|
def hello
|
||||||
recipients 'test@localhost'
|
recipients 'test@localhost'
|
||||||
subject "You have a mail"
|
subject "You have a mail"
|
||||||
|
@ -51,6 +51,16 @@ class ExplicitLayoutMailer < ActionMailer::Base
|
||||||
end
|
end
|
||||||
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
|
class LayoutMailerTest < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
set_delivery_method :test
|
set_delivery_method :test
|
||||||
|
@ -77,7 +87,7 @@ class LayoutMailerTest < Test::Unit::TestCase
|
||||||
# CHANGED: content_type returns an object
|
# CHANGED: content_type returns an object
|
||||||
# assert_equal 'text/plain', mail.parts.first.content_type
|
# assert_equal 'text/plain', mail.parts.first.content_type
|
||||||
assert_equal 'text/plain', mail.parts.first.mime_type
|
assert_equal 'text/plain', mail.parts.first.mime_type
|
||||||
|
|
||||||
# CHANGED: body returns an object
|
# 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
|
||||||
assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body.to_s
|
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
|
mail = ExplicitLayoutMailer.logout
|
||||||
assert_equal "You logged out", mail.body.to_s.strip
|
assert_equal "You logged out", mail.body.to_s.strip
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue