public
Description: Mechanize is a ruby library that makes automated web interaction easy.
Homepage: http://mechanize.rubyforge.org/
Clone URL: git://github.com/aaronp/mechanize.git
Search Repo:
supporting empty values for select lists. [#19975]
aaronp (author)
Sun May 11 18:26:08 -0700 2008
commit  a37ae038f5bef1064045bd1cc06280f2932f43d3
tree    a46ca4e35886338f2848bf52c8ea6c7b985a0d64
parent  119ef6a6cd3cd880c2024cd8dc8cadd18876739c
...
18
19
20
 
 
21
22
23
...
18
19
20
21
22
23
24
25
0
@@ -18,6 +18,8 @@
0
     http://rubyforge.org/tracker/index.php?func=detail&aid=19178&group_id=1453&atid=5711
0
   * Defaulting option tags to the inner text.
0
     http://rubyforge.org/tracker/index.php?func=detail&aid=19976&group_id=1453&atid=5709
0
+ * Supporting blank strings for option values.
0
+ http://rubyforge.org/tracker/index.php?func=detail&aid=19975&group_id=1453&atid=5709
0
 
0
 == 0.7.5
0
 
...
35
36
37
 
 
 
 
38
39
40
...
35
36
37
38
39
40
41
42
43
44
0
@@ -35,6 +35,10 @@
0
             super([new.to_s])
0
           end
0
         end
0
+
0
+ def query_value
0
+ value ? [[name, value]] : ''
0
+ end
0
       end
0
     end
0
   end
...
73
74
75
 
 
 
 
 
 
 
 
 
76
77
78
...
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
0
@@ -73,6 +73,15 @@
0
     assert_equal(1, page.links.text('list:1').length)
0
   end
0
 
0
+ def test_select_with_empty_value
0
+ list = @form.fields.name('list').first
0
+ list.options.last.instance_variable_set(:@value, '')
0
+ list.options.last.tick
0
+ page = @agent.submit(@form)
0
+ assert_equal(1, page.links.length)
0
+ assert_equal(1, page.links.text('list:').length)
0
+ end
0
+
0
   def test_select_with_click
0
     @form.list = ['1', 'Aaron']
0
     @form.fields.name('list').first.options[3].tick

Comments

    No one has commented yet.