Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

email fields behave like text fields wrt the set function

  • Loading branch information...
commit 9971edbf21822d455caefde7f7fed92cd4fe6ab9 1 parent 8674ef7
@jkrall jkrall authored jferris committed
Showing with 7 additions and 1 deletion.
  1. +6 −0 spec/driver_spec.rb
  2. +1 −1  src/capybara.js
View
6 spec/driver_spec.rb
@@ -503,6 +503,7 @@
<form action="/" method="GET">
<input class="watch" type="text"/>
<input class="watch" type="password"/>
+ <input class="watch" type="email"/>
<textarea class="watch"></textarea>
<input class="watch" type="checkbox"/>
<input class="watch" type="radio"/>
@@ -559,6 +560,11 @@
subject.find("//li").map(&:text).should == keyevents
end
+ it "triggers email input events" do
+ subject.find("//input[@type='email']").first.set(newtext)
+ subject.find("//li").map(&:text).should == keyevents
+ end
+
it "triggers radio input events" do
subject.find("//input[@type='radio']").first.set(true)
subject.find("//li").map(&:text).should == %w(click change)
View
2  src/capybara.js
@@ -106,7 +106,7 @@ Capybara = {
set: function(index, value) {
var node = this.nodes[index];
var type = (node.type || node.tagName).toLowerCase();
- if (type == "text" || type == "textarea" || type == "password") {
+ if (type == "text" || type == "textarea" || type == "password" || type == "email") {
this.trigger(index, "focus");
node.value = "";
var maxLength = this.attribute(index, "maxlength"),
Please sign in to comment.
Something went wrong with that request. Please try again.