[rspec-users] webrat cannot find label?

James Byrne lists at ruby-forum.com
Fri Nov 14 12:32:44 EST 2008

Bart Zonneveld wrote:
> On 13-nov-2008, at 20:41, James B. Byrne wrote:

> Are you 100% sure the thing you are selecting exists in the select
> box? That has bitten me in the butt a few times..
> cheers,
> bartz

This is what Rails generates from the view:

<label class="input_box" for="entity_entity_legal_form" title="Legal 
form is one of PERS, CORP or PART">
  <b>Legal Form: </b><br />
<select id="entity_entity_legal_form" name="entity[entity_legal_form]">
  <option value="">Select the type of entity</option>
  <option value="CORP">CORP - Corporation</option>
  <option value="PART">PART - Partnership</option>
  <option value="PERS">PERS - Natural Person</option>

So, it appears to me that the label and target ids match, 
"entity_entity_legal_form"; and the value that I am testing, "CORP" is 
available in the list of values.
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list