<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -68,6 +68,7 @@
 
 * Bug fixes
   
+  * field_labeled should disregard labels without matching fields (Kyle Hargraves)
   * Fixed bug where Scope was creating a new DOM rather than re-using the existing DOM.
     [#105] (Zach Dennis)
   * Support Rails &gt; v2.2 by using ActionController::RequestParser for param parsing [#107]</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ module Webrat
     class FieldLabeledLocator &lt; Locator # :nodoc:
   
       def locate
-        matching_labels.any? &amp;&amp; matching_labels.first.field
+        matching_labels.any? &amp;&amp; matching_labels.detect_mapped { |label| label.field }
       end
       
       def matching_labels
@@ -53,4 +53,4 @@ module Webrat
     end
     
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/webrat/core/locators/field_labeled_locator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -138,5 +138,20 @@ describe &quot;field_labeled&quot; do
     with_an_id_of  &quot;element_42&quot;,       :for =&gt; &quot;A label with a link on it's own line&quot;
     should_raise_error_matching /Could not find .* &quot;Other Label&quot;/, :for =&gt; &quot;Other Label&quot;
   end
+
+  describe &quot;finding a field when labels without fields also match&quot; do
+    using_this_html &lt;&lt;-HTML
+      &lt;html&gt;
+        &lt;label&gt;The Label&lt;/label&gt;
+        &lt;form&gt;
+          &lt;label for=&quot;element_42&quot;&gt;The Label&lt;/label&gt;
+          &lt;input type=&quot;text&quot; id=&quot;element_42&quot;&gt;
+        &lt;/form&gt;
+      &lt;/html&gt;
+    HTML
+
+    should_return_a Webrat::TextField, :for =&gt; &quot;The Label&quot;
+    with_an_id_of   &quot;element_42&quot;,      :for =&gt; &quot;The Label&quot;
+  end
   
 end</diff>
      <filename>spec/public/locators/field_labeled_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cbd323ac37ee5fdee7339f4bb9caf921ed9f0cd0</id>
    </parent>
  </parents>
  <author>
    <name>Kyle Hargraves</name>
    <email>philodespotos@gmail.com</email>
  </author>
  <url>http://github.com/johnnyt/webrat/commit/2b38b787245911555dd1787dfb5dee12ca324973</url>
  <id>2b38b787245911555dd1787dfb5dee12ca324973</id>
  <committed-date>2009-01-18T13:57:08-08:00</committed-date>
  <authored-date>2009-01-18T13:43:51-08:00</authored-date>
  <message>field_labeled() should disregard labels without matching fields</message>
  <tree>25bf26e6d1c885819368aedc100ab2726d20783e</tree>
  <committer>
    <name>Kyle Hargraves</name>
    <email>philodespotos@gmail.com</email>
  </committer>
</commit>
