Disable the automatic following of redirects in the Mechanize instance so they can be handled by Webrat::Session

This commit is contained in:
Emrys Ingersoll 2010-02-18 18:33:22 -05:00
parent d9d9cc1fcc
commit b2dddf2f09

View File

@ -40,7 +40,11 @@ module Webrat #:nodoc:
end
def mechanize
@mechanize ||= WWW::Mechanize.new
unless @mechanize
@mechanize = Mechanize.new
@mechanize.redirect_ok = false
end
@mechanize
end
def_delegators :mechanize, :basic_auth