Skip to content

Commit

Permalink
Cleanup assert_tag :children counting. Closes #2181.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4915 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Sep 3, 2006
1 parent a769b88 commit db9be58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN* *SVN*


* Cleanup assert_tag :children counting. #2181 [jamie@bravenet.com]

* button_to accepts :method so you can PUT and DELETE with it. #6005 [Dan Webb] * button_to accepts :method so you can PUT and DELETE with it. #6005 [Dan Webb]


* Update sanitize text helper to strip plaintext tags, and <img src="javascript:bang">. [Rick Olson] * Update sanitize text helper to strip plaintext tags, and <img src="javascript:bang">. [Rick Olson]
Expand Down
Expand Up @@ -455,7 +455,6 @@ def match(conditions)
# count children # count children
if opts = conditions[:children] if opts = conditions[:children]
matches = children.select do |c| matches = children.select do |c|
c.match(/./) or
(c.kind_of?(HTML::Tag) and (c.closing == :self or ! c.childless?)) (c.kind_of?(HTML::Tag) and (c.closing == :self or ! c.childless?))
end end


Expand Down
2 changes: 2 additions & 0 deletions actionpack/test/controller/test_test.rb
Expand Up @@ -215,6 +215,8 @@ def test_assert_tag_children_count


# there is a tag with 2 children # there is a tag with 2 children
assert_tag :children => { :count => 2 } assert_tag :children => { :count => 2 }
# in particular, there is a <ul> tag with two children (a nameless pair of <li>s)
assert_tag :tag => 'ul', :children => { :count => 2 }
# there is no tag with 4 children # there is no tag with 4 children
assert_no_tag :children => { :count => 4 } assert_no_tag :children => { :count => 4 }
end end
Expand Down

0 comments on commit db9be58

Please sign in to comment.