I'm attempting to verify a value for a drop down using ruby's mechanize
I've got this pretty printed form:
Before:
#<Mechanize::Form
...
[selectlist:0xefdae4 type: name: time_entry[activity_id] value: []]}
...
{buttons [submit:0xefe124 type: submit name: commit value: Save]}>
After:
#<Mechanize::Form
...
[selectlist:0xefdae4 type: name: time_entry[activity_id] value: []]}
...
{buttons [submit:0xefe124 type: submit name: commit value: Save]}>
The code I'm running:
@form.field_with(:name => "time_entry[activity_id]").options[2].select
... corresponding to the 3rd option: "Testing"
And the select HTML element:
<select id="time_entry_activity_id" name="time_entry[activity_id]">
<option value="">--- Please select ---</option>
<option value="8">Design</option>
<option value="9">Development</option>
<option value="13">Testing</option>
<option value="14">Dingo</option>
<option value="15">ABPs</option>
</select>
I'm attempting to get some kind of verification of what item is selected from the select box.