[rspec-users] webrat cannot find label?

James Byrne lists at ruby-forum.com
Fri Nov 14 15:38:59 EST 2008


Barry Mitchelson wrote:
> On Thu, Nov 13, 2008 at 7:41 PM, James B. Byrne 
> <byrnejb at harte-lyne.ca>wrote:
> 
>>
>> On Thu, November 13, 2008 14:02, James B. Byrne wrote:
>>
>> >
>> > What is the correct syntax to test selecting from a range of values
>> > present in an input box?  ...
>>
> 
>> The webrat API specifies this:
>>
>>  selects(option_text, options = {})
>>
>> Verifies that a an option element exists on the current page with the
>> specified text. You can optionally restrict the search to a specific
>> select list by assigning options[:from] the value of the select list's
>> name or a label. Stores the option's value to be sent when the form is
>> submitted.
>>
> 
> The API says to use the option text, not the value.
> 
...
> 
> CORP is the value of the option, the text is "CORP - Corporation"
> 
> Does this work?
> 
> Barry

I'll be damned... It works.

Thank you so very much. I would never have connected "option_text" to 
the description portion of the list.
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list