small refactor

This commit is contained in:
Rob Holland 2009-12-09 09:34:12 +00:00
parent b4bce58fd8
commit 4a55c1a7cb
1 changed files with 1 additions and 4 deletions

View File

@ -17,16 +17,13 @@ class Capybara::Driver::Selenium
end
def set(value)
if tag_name == 'input' and %w(text password hidden file).include?(type)
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'
node.select
elsif tag_name == 'input' and type == 'checkbox'
node.toggle
elsif tag_name == "textarea"
node.clear
node.send_keys(value.to_s)
end
end