title: Capybara assert dropdown having a desired value selected not working
body: <pre><code>$ruby --version
  ruby 1.9.3dev (2011-09-23 revision 33323) [i686-linux]
  
  gem 'rails', '3.2.9'
  
  group :test do
    gem 'cucumber-rails', require: false
    gem 'capybara', '~&gt; 2.0.3'
    gem 'rspec-rails'
    gem 'database_cleaner'
    gem 'factory_girl'
    gem "ffaker"
    gem "capybara-firebug", "~&gt; 1.3.0"
    gem 'ruby-debug19'
  end
  </code></pre>
  
  <p>In one of my Cucumber Step I am trying to assert that a drop-down element
  (&lt;select&gt; tag) has a particular option selected using Capybara API
  with the following code.</p>
  
  <pre><code>  within('#myForm') do
      page.has_select?("#event_type", selected: @event_type).should be_true
    end
  </code></pre>
  
  <p>However I am getting this error:</p>
  
  <pre><code>   expected: true value
     got: false (RSpec::Expectations::ExpectationNotMetError)
  </code></pre>
  
  <p>I inspected the DOM using <strong>@firebug</strong> tag of (capybara-firebug) on my scenario
  and found that the desired option (held by @event_type) is getting selected
  in the drop-down however in the DOM the "selected" attribute is not getting
  added to the select tag which I guess is causing the expectation to fail.</p>
  
  <p>I found a similar reference here: <a href="https://github.com/jnicklas/capybara/issues/171" rel="nofollow">https://github.com/jnicklas/capybara/issues/171</a>
  which mentions about the commit having the fix but I guess the commit is not
  merged to the capybara version I am using.I trying digging in the source code
  and found that the fixes mentioned at <a href="https://github.com/jnicklas/capybara/issues/171" rel="nofollow">https://github.com/jnicklas/capybara/issues/171</a>
  are not present in the Capybara's codebase.</p>
  
  <p>Can any body please let me know how to assert that a select tag has a
  particular option selected?</p>
  
  <p>Note: When using capybara in my Gem file without any version:</p>
  
  <pre><code>gem 'capybara'
  </code></pre>
  
  <p>Capybara Version 2.1.0 is initiated to be installed however it fails with error:</p>
  
  <pre><code>capybara requires Ruby version &gt;= 1.9.3
  </code></pre>
  
  <p>though I have the required ruby version.</p>
  
  <p>Following is the output of </p>
  
  <pre><code>  $ rvm info
    ruby-1.9.3-rc1:
  
  system:
    uname:       "Linux jigneshgohel-Inspiron-N5110 3.2.0-40-generic-pae #64-Ubuntu SMP Mon Mar 25 21:44:41 UTC 2013 i686 i686 i386 GNU/Linux"
    bash:        "/bin/bash =&gt; GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu)"
    zsh:         " =&gt; not installed"
  
  rvm:
    version:      "rvm 1.13.4 (stable) by Wayne E. Seguin &lt;wayneeseguin@gmail.com&gt;, Michal Papis &lt;mpapis@gmail.com&gt; [https://rvm.io/]"
    updated:      "11 months 4 days 14 hours 20 minutes 18 seconds ago"
  
  ruby:
    interpreter:  "ruby"
    version:      "1.9.3dev"
    date:         "2011-09-23"
    platform:     "i686-linux"
    patchlevel:   "2011-09-23 revision 33323"
    full_version: "ruby 1.9.3dev (2011-09-23 revision 33323) [i686-linux]"
  
  homes:
    gem:          "/home/jigneshgohel/.rvm/gems/ruby-1.9.3-rc1"
    ruby:         "/home/jigneshgohel/.rvm/rubies/ruby-1.9.3-rc1"
  
  binaries:
    ruby:         "/home/jigneshgohel/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby"
    irb:          "/home/jigneshgohel/.rvm/rubies/ruby-1.9.3-rc1/bin/irb"
    gem:          "/home/jigneshgohel/.rvm/rubies/ruby-1.9.3-rc1/bin/gem"
    rake:         "/home/jigneshgohel/.rvm/gems/ruby-1.9.3-rc1/bin/rake"
  
  environment:
    PATH:         "/home/jigneshgohel/.rvm/gems/ruby-1.9.3-rc1/bin:/home/jigneshgohel/.rvm/gems/ruby-1.9.3-rc1@global/bin:/home/jigneshgohel/.rvm/rubies/ruby-1.9.3-rc1/bin:/home/jigneshgohel/.rvm/bin:/usr/local/heroku/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/media/work/Environment/Languages/Java/jdk1.7.0_04/bin:/media/work/Environment/BuildTools/apache-maven-3.0.4/bin:/media/work/Environment/BuildTools/apache-ant-1.8.3/bin"
    GEM_HOME:     "/home/jigneshgohel/.rvm/gems/ruby-1.9.3-rc1"
    GEM_PATH:     "/home/jigneshgohel/.rvm/gems/ruby-1.9.3-rc1:/home/jigneshgohel/.rvm/gems/ruby-1.9.3-rc1@global"
    MY_RUBY_HOME: "/home/jigneshgohel/.rvm/rubies/ruby-1.9.3-rc1"
    IRBRC:        "/home/jigneshgohel/.rvm/rubies/ruby-1.9.3-rc1/.irbrc"
    RUBYOPT:      ""
    gemset:       "
  </code></pre>
  
  <p>Following is the output of:</p>
  
  <pre><code>  $rvm list
    rvm rubies
  
    =* ruby-1.9.3-rc1 [ i686 ]
  
    # =&gt; - current
    # =* - current &amp;&amp; default
    #  * - default
  </code></pre>