>From reading the error and the docs, it sounds like the last one:

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

...should work. The one thing I can think of that might keep it from
working would be not being scoped to an area that includes the select box.
Perhaps you could install pry and add binding.pry above that line, and then
run it, and then poke around in the repl and see if you've got the right
context. You did make the request to get that page, right?

Ben

On Wed, Feb 29, 2012 at 10:04 PM, S Ahmed <sahmed1...@gmail.com> wrote:

> 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>
> </select>
> My requests spec looks like:
>
> before do
>   select '7', :from => "account[car_type]"
>   fill_in ..
>   ..
>
> end
>
> I get the error message:
>
>  Failure/Error: select '7', :from => "account[car_type]"
>      Capybara::ElementNotFound:
>        cannot select option, no option with text '7' in select box
> 'account[car_type]'
>      # (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?
>
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to