Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added failing tests for click_button to find and submit image input b…

…uttons using the text of the alt attribute
  • Loading branch information...
commit 125478fe2666e81d4c9ba3721dacf231987deb6c 1 parent 99a3bd8
Bo Jeanes bjeanes authored

Showing 2 changed files with 13 additions and 1 deletion. Show diff stats Hide diff stats

  1. +12 0 spec/dsl/click_button_spec.rb
  2. +1 1  spec/views/form.erb
12 spec/dsl/click_button_spec.rb
@@ -113,6 +113,18 @@
113 113 @session.body.should include('You landed')
114 114 end
115 115 end
  116 +
  117 + context "with alt given on an image button" do
  118 + it "should submit the associated form" do
  119 + @session.click_button('oh hai thar')
  120 + extract_results(@session)['first_name'].should == 'John'
  121 + end
  122 +
  123 + it "should work with partial matches" do
  124 + @session.click_button('hai')
  125 + extract_results(@session)['first_name'].should == 'John'
  126 + end
  127 + end
116 128
117 129 context "with value given on an image button" do
118 130 it "should submit the associated form" do
2  spec/views/form.erb
@@ -151,7 +151,7 @@
151 151 <input type="button" name="form[fresh]" id="fresh_btn" value="i am fresh"/>
152 152 <input type="submit" name="form[awesome]" id="awe123" value="awesome"/>
153 153 <input type="submit" name="form[crappy]" id="crap321" value="crappy"/>
154   - <input type="image" name="form[okay]" id="okay556" value="okay"/>
  154 + <input type="image" name="form[okay]" id="okay556" value="okay" alt="oh hai thar"/>
155 155 <button type="submit" id="click_me_123" value="click_me">Click me!</button>
156 156 </p>
157 157 </form>

0 comments on commit 125478f

Please sign in to comment.
Something went wrong with that request. Please try again.