public
Fork of brynary/webrat
Description: Webrat - Ruby Acceptance Testing for Web applications
Homepage: http://www.brynary.com/uploads/webrat/rdoc/index.html
Clone URL: git://github.com/gwynm/webrat.git
Now you can do clicks_button 'foo_123' (passing button ID, not value)
Gwyn Morfey (author)
Mon Jul 07 07:57:52 -0700 2008
commit  9e673539a5f8ed0f8aaec78dc8c5225612e8191e
tree    706444dc7bf362e854804a7bff75c510cf88a52d
parent  20561b0c411c687cd755be381109937910fcda97
...
106
107
108
 
 
 
 
109
110
111
...
106
107
108
109
110
111
112
113
114
115
0
@@ -106,6 +106,10 @@ module Webrat
0
       @element["value"] =~ /^\W*#{Regexp.escape(value.to_s)}/i
0
     end
0
     
0
+ def matches_id?(id)
0
+ @element["id"] =~ /^\W*#{Regexp.escape(id.to_s)}/i
0
+ end
0
+
0
     def matches_caption?(value)
0
       @element.innerHTML =~ /^\W*#{Regexp.escape(value.to_s)}/i
0
     end
...
34
35
36
 
 
 
 
37
38
39
...
34
35
36
37
38
39
40
41
42
43
0
@@ -34,6 +34,10 @@ module Webrat
0
       possible_buttons = fields_by_type([ButtonField])
0
       
0
       possible_buttons.each do |possible_button|
0
+ return possible_button if possible_button.matches_id?(value)
0
+ end
0
+
0
+ possible_buttons.each do |possible_button|
0
         return possible_button if possible_button.matches_value?(value)
0
       end
0
       

Comments

    No one has commented yet.