lib/webrat/core/elements/form.rb in diabolo-webrat-0.4.4.2 vs lib/webrat/core/elements/form.rb in diabolo-webrat-0.5.1

- old
+ new

@@ -7,11 +7,11 @@ module Webrat class Form < Element #:nodoc: attr_reader :element def self.xpath_search - ".//form" + [".//form"] end def fields @fields ||= Field.load_all(@session, @element) end @@ -25,11 +25,11 @@ end protected def dom - Webrat::XML.xpath_at(@session.dom, path) + @session.dom.xpath(path).first end def fields_by_type(field_types) if field_types.any? fields.select { |f| field_types.include?(f.class) } @@ -48,14 +48,14 @@ all_params end def form_method - Webrat::XML.attribute(@element, "method").blank? ? :get : Webrat::XML.attribute(@element, "method").downcase + @element["method"].blank? ? :get : @element["method"].downcase end def form_action - Webrat::XML.attribute(@element, "action").blank? ? @session.current_url : Webrat::XML.attribute(@element, "action") + @element["action"].blank? ? @session.current_url : @element["action"] end def merge(all_params, new_param) new_param.each do |key, value| case all_params[key]