Require English so we can use $LAST_MATCH_INFO instead of $~

This commit is contained in:
Bryan Helmkamp 2009-06-15 00:08:25 -04:00
parent 6720bbb476
commit 9b971a15c0

View File

@ -1,5 +1,6 @@
require "webrat/core_extensions/blank" require "English"
require "webrat/core_extensions/blank"
require "webrat/core/elements/element" require "webrat/core/elements/element"
module Webrat module Webrat
@ -53,7 +54,7 @@ module Webrat
def authenticity_token def authenticity_token
return unless onclick && onclick.include?("s.setAttribute('name', 'authenticity_token');") && return unless onclick && onclick.include?("s.setAttribute('name', 'authenticity_token');") &&
onclick =~ /s\.setAttribute\('value', '([a-f0-9]{40})'\);/ onclick =~ /s\.setAttribute\('value', '([a-f0-9]{40})'\);/
$~.captures.first $LAST_MATCH_INFO.captures.first
end end
def onclick def onclick