[rspec-users] specifying which button webrat should press

Zach Dennis zach.dennis at gmail.com
Fri Feb 20 16:03:48 EST 2009

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

More information about the rspec-users mailing list