title: How to test selecting dates with rspec?
body: <p><strong>How to test the following code with integration rspec test (I'm also using capybara) ?</strong></p>
  
  <pre><code> 1 &lt;%= form_for [@project, @task] do |f| %&gt;
  
   17   &lt;p&gt;
   18     &lt;%= f.date_select(:target_date,
   19                       :default =&gt; Date.today,         
   20                       :order =&gt; [:day, :month, :year], :start_year =&gt; Date.today.year, 
   21                       :end_year =&gt; Date.today.year + 3) %&gt;
   22   &lt;/p&gt;                
   23 
   24   &lt;%= f.submit %&gt;
   25 
   26 &lt;% end %&gt;
  </code></pre>
  
  <p>So far I have the following piece of code...</p>
  
  <pre><code>select '28', :from =&gt; :day 
  </code></pre>
  
  <p>...but it says > <strong>cannot select option, no select box with id, name, or label 'day' found</strong></p>
  
  <p>EDIT: Upon looking at the HTML output of the page I noticed Rails automatically adds id's to day, month and year field...
  The output for day for example looks like this...</p>
  
  <pre><code>&lt;select id="show_date_3i" name="show[date(3i)]"&gt;&lt;option value="1"&gt;1&lt;/option&gt;
  </code></pre>
  
  <p>But then again when I do this...</p>
  
  <pre><code>select '28', :from =&gt; :show_date_3i
  </code></pre>
  
  <p>... it says >>> <strong>cannot select option, no select box with id, name, or label 'show_date_3i' found</strong>... Why is that?</p>