From 1771f53eacc4f037ce82b874ddbfdf802f7f2a66 Mon Sep 17 00:00:00 2001 From: mcrmfc Date: Fri, 3 Feb 2012 13:59:54 +0000 Subject: [PATCH] mechnanize 2.1 performs a sort on an array of form fields in order for us not to break this we need to pass in a native node --- lib/capybara/mechanize/node.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capybara/mechanize/node.rb b/lib/capybara/mechanize/node.rb index ffc1b51..b72b0c9 100644 --- a/lib/capybara/mechanize/node.rb +++ b/lib/capybara/mechanize/node.rb @@ -5,7 +5,7 @@ def click driver.follow(method, self[:href].to_s) elsif (tag_name == 'input' and %w(submit image).include?(type)) or ((tag_name == 'button') and type.nil? or type == "submit") - Capybara::Mechanize::Form.new(driver, form).submit(self) + Capybara::Mechanize::Form.new(driver, form).submit(self.native) #pass native so Mechanize gets Nokogiri::XML::Element end end end