Allow SeleniumSession's click_button to be called without an argument without blowing up.

This commit is contained in:
Luke Melia 2008-12-18 02:48:36 -05:00
parent 492a301449
commit f3dfa329b5

View File

@ -53,7 +53,7 @@ module Webrat
def click_button(button_text_or_regexp = nil, options = {})
if button_text_or_regexp.is_a?(Hash) && options == {}
pattern, options = nil, button_text_or_regexp
else
elsif button_text_or_regexp
pattern = adjust_if_regexp(button_text_or_regexp)
end
pattern ||= '*'