[rspec-users] specifying which button webrat should press

Zach Dennis
2009-02-20T21:03:48Z

On Fri, Feb 20, 2009 at 3:50 PM, James Byrne <lists at ruby-forum.com>
wrote:
> Zach Dennis wrote:
>
>>
>> Can you use the following or do you need to use an id for other reason?
>>
>>    click_button "Create"
>>
>
> That is how I am doing the check now.  I am simply investigating whether
> another means is available to me.

You should be able to click the button by id, by not using a CSS selector. ie:

   click_button "submit_commit_client"


> At the back of my mind is the idea
> that it is the presence of the function and not the form of the label
> that is important.  By adding an id to the input tag and selecting on
> that then whatever the button itself is labeled as becomes unimportant.


--
Zach Dennis