title: Rspec: Capybara select not working
body: <p>I am using JS enabled Capybara with <code>selenium-webdriver</code> for my feature test.</p>
  
  <p>I would like to select a brand from select box</p>
  
  <p><strong>And here is my HTML</strong></p>
  
  <pre><code>&lt;select id="campaign_brand_id" name="campaign[brand_id]" class="form-control"&gt;
    &lt;option value=""&gt;Choose a Brand&lt;/option&gt;
    &lt;option value="1"&gt;Brand1&lt;/option&gt;
    &lt;option value="2"&gt;Brand2&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>Here is my test code</strong></p>
  
  <pre><code>before(:each) do
    @brand = FactoryGirl.create(:brand, name: 'Brand1', company: member.company)
  end
  
  scenario 'Create a new campaign - with minimum valid data', js: true do
    visit new_brands_campaign_url(host: "skreem.dev", port: Capybara.current_session.server.port)
  
    select (@brand.name), from: 'campaign_brand_id'
    click_button 'Create Campaign'
  end
  </code></pre>
  
  <p>I have tried the following too...</p>
  
  <pre><code>1. select (@brand.name), from: 'campaign[brand_id]'
  2. select (@brand.id), from: 'campaign_brand_id'
  3. find('#campaign_brand_id').find(:xpath, "option[#{@brand.id}]").select_option
  4. within '#campaign_brand_id' do
       find("option[value='1']").click
     end
  </code></pre>
  
  <p>Other capybara commands like <code>fill_in</code> <code>choose</code> <code>click_button</code> are working... I am using <strong><code>collection_select</code></strong> in the view... Is that causing this problem?</p>
  
  <p><a href="https://i.stack.imgur.com/tL8OB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tL8OB.png" alt="enter image description here"></a></p>