Require English so we can use $LAST_MATCH_INFO instead of $~
This commit is contained in:
parent
6720bbb476
commit
9b971a15c0
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue