[rspec-users] issues when trying to select an option in a drop down list

S Ahmed sahmed1020 at gmail.com
Thu Mar 1 05:04:00 UTC 2012

My html looks like:

<select id="account_car_type" name="account[car_type]"><option value="6
">Acura</option> <option value="7">Honda</option> <option value="8">Ford
</option> <option value="9">Toyota</option> <option value="10">GM</option>
My requests spec looks like:

before do
  select '7', :from => "account[car_type]"
  fill_in ..


I get the error message:

 Failure/Error: select '7', :from => "account[car_type]"
       cannot select option, no option with text '7' in select box
     # (eval):2:in `select'
     # ./spec/requests/account_pages_spec.rb:13:in `block (4 levels) in
<top (required)>'

I also tried:

select 'Honda', :from => "account[car_type]"

And got the same type of error.

What am I doing wrong here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120301/c6d64312/attachment.html>

More information about the rspec-users mailing list