I’m trying to use Capybara to test this. I have a step that goes
When I select "Price Chopper" from "Organization"
And the step definition is
When /^(?:|I )select “(.+)” from “(.+)”$/ do |value, field|
select(value, :from => field)
end
For some reason, I keep getting the error:
cannot select option, no select box with id, name, or label
‘Organization’
found (Capybara::ElementNotFound)
(eval):2:in `select'
although my view is
Organization
<%= collection_select :restaurant, :organization_id, Organization.all,
:id,
:name, { :prompt => “[Select organization]” } %>
Shouldn’t this work? The label is “Organization”!