When you save_and_open_page, you can see that my form contains:
<label class="select optional control-label" for="assignment_role_id">Role</label>
<select class="select optional" id="assignment_role_id" name="assignment[role_id]">
<option value="819">admin</option>
<option value="820">customer</option>
</select>
Why, then, won’t Capybara select the right item in the drop down menu? I get:
Failure/Error: select("customer", :from => :Role)
Capybara::ElementNotFound:
cannot select option, no option with text 'customer' in select box 'Role'
…and…
Failure/Error: select("customer", :from => :assignment_role_id)
Capybara::ElementNotFound:
cannot select option, no option with text 'customer' in select box 'assignment_role_id'
…and…
Failure/Error: select("customer", :from => :role_id)
Capybara::ElementNotFound:
cannot select option, no option with text 'customer' in select box 'role_id'
Solution was: