Select fields with duplicate selected options sent an incorrect value
This commit is contained in:
parent
03914fd293
commit
ff42db076f
@ -15,6 +15,7 @@
|
||||
|
||||
* Don't create a new instance of WWW::Mechanize for each request
|
||||
(Mark Menard)
|
||||
* Select fields with duplicate selected options sent an incorrect value (Noah Davis)
|
||||
|
||||
== 0.4.3 / 2009-03-17
|
||||
|
||||
|
@ -396,7 +396,7 @@ module Webrat
|
||||
selected_options.map do |option|
|
||||
return "" if option.nil?
|
||||
Webrat::XML.attribute(option, "value") || Webrat::XML.inner_html(option)
|
||||
end
|
||||
end.uniq
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -243,4 +243,19 @@ describe "select" do
|
||||
pending("needs bug fix", &spec)
|
||||
end
|
||||
end
|
||||
|
||||
it "should submit duplicates selected options as a single value" do
|
||||
with_html <<-HTML
|
||||
<html>
|
||||
<form method="post" action="/login">
|
||||
<select name="clothes"><option value="pants" selected="selected">pants</option><option value="pants" selected="selected">pants</option></select>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
</html>
|
||||
HTML
|
||||
|
||||
webrat_session.should_receive(:post).with("/login", "clothes" => "pants")
|
||||
click_button
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user