Created
February 4, 2010 16:10
-
-
Save robholland/294804 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/capybara/driver/selenium_driver.rb b/lib/capybara/driver/selenium_driver.rb | |
index d78cc51..70cc145 100644 | |
--- a/lib/capybara/driver/selenium_driver.rb | |
+++ b/lib/capybara/driver/selenium_driver.rb | |
@@ -17,13 +17,13 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base | |
end | |
def set(value) | |
- if tag_name == 'textarea' or (tag_name == 'input' and %w(text password hidden file).include?(type)) | |
- node.clear | |
- node.send_keys(value.to_s) | |
- elsif tag_name == 'input' and type == 'radio' | |
+ if tag_name == 'input' and type == 'radio' | |
node.select | |
elsif tag_name == 'input' and type == 'checkbox' | |
node.toggle | |
+ else | |
+ node.clear | |
+ node.send_keys(value.to_s) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment