lib/watir-webdriver/extensions/alerts.rb in watir-webdriver-0.1.3 vs lib/watir-webdriver/extensions/alerts.rb in watir-webdriver-0.1.4

- old
+ new

@@ -47,14 +47,14 @@ # This method is provided by an optional require - API is subject to change. # # @example # browser.prompt("hello") do # browser.button(:value => "Prompt").click - # end #=> { :message => "foo", :default => "bar" } + # end #=> { :message => "foo", :default_value => "bar" } # def prompt(answer, &blk) - execute_script "window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default: value }; return #{answer.to_json}; }" + execute_script "window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default_value: value }; return #{answer.to_json}; }" yield result = execute_script "return window.__lastWatirPrompt" result && result.dup.each_key { |k| result[k.to_sym] = result.delete(k)} result