title: Cucumber: find the input with label text X?
body: <p>In Cucumber, I'm trying to create a step like this:</p>
  
  <pre><code>Then I should see "Example business name" in the "Business name" input
  </code></pre>
  
  <p>I'd like the "Business name" input to be defined as "the input whose label has text "Business name."</p>
  
  <p>Here's what I've got on the step so far:</p>
  
  <pre><code>Then /^I should see "([^"]*)" in the "([^"]*)" input$/ do |content, labeltext|
    # Not sure what to put here
  end
  </code></pre>
  
  <p>In jQuery, I'd look for the label with that text, look at its "for" attribute, and find the input with that id. But the only selectors I've seen so far in Cucumber are these:</p>
  
  <pre><code>within("input:nth-child(#{pos.to_i}")
  </code></pre>
  
  <p>and </p>
  
  <pre><code>page.should have_content('foo')
  </code></pre>
  
  <p>Can anybody suggest a solution using the Webrat / Capybara selector syntax?</p>