1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add documentation to assert_tag indicating that it only works with well-formed XHTML

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2005-11-06 13:59:07 +00:00
parent afe75566cc
commit 0073a759f1
2 changed files with 8 additions and 0 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Add documentation to assert_tag indicating that it only works with well-formed XHTML #1937, #2570 [Jamis Buck]
* Added action_pack.rb stub so that ActionPack::Version loads properly [Sam Stephenson]
* Added short-hand to assert_tag so assert_tag :tag => "span" can be written as assert_tag "span" [DHH]

View file

@ -257,6 +257,12 @@ module Test #:nodoc:
# :attributes => { :class => "enum" } },
# :descendant => { :tag => "span",
# :child => /hello world/ }
#
# <strong>Please note</strong: #assert_tag and #assert_no_tag only work
# with well-formed XHTML. They recognize a few tags as implicitly self-closing
# (like br and hr and such) but will not work correctly with tags
# that allow optional closing tags (p, li, td). <em>You must explicitly
# close all of your tags to use these assertions.</em>
def assert_tag(*opts)
clean_backtrace do
opts = opts.size > 1 ? opts.last.merge({ :tag => opts.first.to_s }) : opts.first