From 125478fe2666e81d4c9ba3721dacf231987deb6c Mon Sep 17 00:00:00 2001 From: Bodaniel Jeanes Date: Thu, 25 Feb 2010 15:34:25 +1000 Subject: [PATCH] Added failing tests for click_button to find and submit image input buttons using the text of the alt attribute --- spec/dsl/click_button_spec.rb | 12 ++++++++++++ spec/views/form.erb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/spec/dsl/click_button_spec.rb b/spec/dsl/click_button_spec.rb index 7a96b8f2..59efe3c7 100644 --- a/spec/dsl/click_button_spec.rb +++ b/spec/dsl/click_button_spec.rb @@ -113,6 +113,18 @@ shared_examples_for "click_button" do @session.body.should include('You landed') end end + + context "with alt given on an image button" do + it "should submit the associated form" do + @session.click_button('oh hai thar') + extract_results(@session)['first_name'].should == 'John' + end + + it "should work with partial matches" do + @session.click_button('hai') + extract_results(@session)['first_name'].should == 'John' + end + end context "with value given on an image button" do it "should submit the associated form" do diff --git a/spec/views/form.erb b/spec/views/form.erb index b5cc45ab..32d926ac 100644 --- a/spec/views/form.erb +++ b/spec/views/form.erb @@ -151,7 +151,7 @@ - +