title: capybara check input type (fill_in vs check vs select)
body: <p>I've got method that fills forms for me with capybara.</p>
  
  <p>After getting some default params from <code>FactoryGirl</code> i'm looping tis way:</p>
  
  <pre><code>form_attributes.each do |field, value|
      if value == false
        value == true ? check("#{model}_#{field}") : uncheck("#{model}_#{field}")
      elsif try(:select,value, from: "#{model}_#{field}")
        select value, from: "#{model}_#{field}"
      elsif try(:fill_in, "#{model}_#{field}", with: value)
        fill_in "#{model}_#{field}", with: value
      else
        raise Capybara::ElementNotFound
      end
  end
  </code></pre>
  
  <p>Unfortunately <code>try(:select,value, from: "#{model}_#{field}")</code> will raise error <code>Capybara::ElementNotFound: Unable to find select box</code> ...</p>
  
  <p>How to tell capybara to  <code>check</code> when element is checkbot and select when element is <code>&lt;select&gt;</code>?</p>
  
  <p>Here is some sample of <code>form_attributes</code>:</p>
  
  <pre><code>{:attitude=&gt;"happy",
   :feedback_date=&gt;2014-08-19 15:35:14 +0200,
   :feedback_action=&gt;"Refund",
   :feedback_details=&gt;"....",
   :approved=&gt;"true"}
  </code></pre>