提交 79212def 编写于 作者: J Jeremy Kemper

Test that #to_xml takes a block. Closes #8471. [seth]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6847 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 6149c39d
......@@ -1598,6 +1598,15 @@ def test_to_xml_including_methods
assert xml.include?(%(<arbitrary-method>I am Jack's profound disappointment</arbitrary-method>))
end
def test_to_xml_with_block
value = "Rockin' the block"
xml = Company.new.to_xml(:skip_instruct => true) do |xml|
xml.tag! "arbitrary-element", value
end
assert_equal "<company>", xml.first(9)
assert xml.include?(%(<arbitrary-element>#{value}</arbitrary-element>))
end
def test_except_attributes
assert_equal(
%w( author_name type id approved replies_count bonus_time written_on content author_email_address parent_id last_read),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册