I guess its somewhat misleading documentation

As I understand it

      assert_select "ol>li" do |elements|
          elements.each do |element|
             assert_select element, "li"
          end
      end

says "For each li element that is a child of ol, assert that the
element is a li "

whereas

      assert_select "ol>li" do
           assert_select "li"
      end

says "For the set of li elements that are children of ol, assert that
the set contains an li element"

The second form is more useful then, if you had something like

<ol id="fruit_basket">
  <li><p class="apple"></p></li>
  <li><p class="pear"></p></li>
  <li><p class="grape"></p></li>
  <li><p class="orange"></p></li>
</ol>

and you want to be able to implement
"assert that the fruit basket contains an apple"


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Ruby on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to