From f1b84510b3162c76f21ce92cd74c5d8f70e746c8 Mon Sep 17 00:00:00 2001 From: Pavel Gabriel Date: Fri, 19 Feb 2010 01:19:21 +0200 Subject: [PATCH] Spec example for XPath.button was added --- spec/xpath_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/xpath_spec.rb b/spec/xpath_spec.rb index 937901b3..4d9662e0 100644 --- a/spec/xpath_spec.rb +++ b/spec/xpath_spec.rb @@ -155,6 +155,19 @@ describe Capybara::XPath do @driver.find(@query).first.value.should == 'seeekrit' end end + + describe '#button' do + it "should find a button by id or content" do + @query = @xpath.button('awe123').to_s + @driver.find(@query).first.value.should == 'awesome' + @query = @xpath.button('okay556').to_s + @driver.find(@query).first.value.should == 'okay' + @query = @xpath.button('click_me_123').to_s + @driver.find(@query).first.value.should == 'click_me' + @query = @xpath.button('Click me!').to_s + @driver.find(@query).first.value.should == 'click_me' + end + end describe '#radio_button' do it "should find a radio button by id or label" do