title: Capybara - how to see if a dropdown element is selected?
body: <p>My HTML is</p>
  
  <pre><code>&lt;select id="auto_policy_autos_attributes_0_ownership" name="auto_policy[autos_attributes][0][ownership]"&gt;
    &lt;option value="Owned"&gt;Owned&lt;/option&gt;
    &lt;option value="Financed"&gt;Financed&lt;/option&gt;
    &lt;option value="Leased" selected="selected"&gt;Leased&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  
  <p>and I can select up to </p>
  
  <pre><code>find('select#auto_policy_autos_attributes_0_ownership option[value="Leased"]')
  </code></pre>
  
  <p>correctly, but how do I see if it has been checked?</p>
  
  <p>I tried</p>
  
  <pre><code>find('select#auto_policy_autos_attributes_0_ownership option[value="Leased" selected="selected"]')
  </code></pre>
  
  <p>but I get</p>
  
  <pre><code>Selenium::WebDriver::Error::InvalidSelectorError: invalid selector: 
  An invalid or illegal selector was specified
  </code></pre>
  
  <p>I had hopes for</p>
  
  <pre><code>'select#auto_policy_autos_attributes_0_ownership option[value="Leased"], selected')).to be
  </code></pre>
  
  <p>but I get a false positive as </p>
  
  <pre><code>'select#auto_policy_autos_attributes_0_ownership option[value="Owned"], selected')).to be
  </code></pre>
  
  <p>returns true, even though I have selected Leased with </p>
  
  <pre><code>select 'Leased', from: 'auto_policy_autos_attributes_0_ownership'
  </code></pre>
  
  <p>which I can see working in the browser.</p>