Fix rack-test to ignore maxlength="", closes #396
This commit is contained in:
parent
f6c787e13a
commit
c51a232bbc
|
@ -23,7 +23,10 @@ class Capybara::RackTest::Node < Capybara::Driver::Node
|
|||
native.remove_attribute('checked')
|
||||
end
|
||||
elsif tag_name == 'input'
|
||||
if (type == 'text' || type == 'password') && self[:maxlength]
|
||||
if (type == 'text' || type == 'password') && self[:maxlength] &&
|
||||
!self[:maxlength].empty?
|
||||
# Browser behavior for maxlength="0" is inconsistent, so we stick with
|
||||
# Firefox, allowing no input
|
||||
value = value[0...self[:maxlength].to_i]
|
||||
end
|
||||
native['value'] = value.to_s
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
<p>
|
||||
<label>Street<br/>
|
||||
<input type="text" name="form[street]" value="Sesame street 66"/>
|
||||
<input type="text" maxlength="" name="form[street]" value="Sesame street 66"/>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
|
|
Loading…
Reference in New Issue