core expects a response so mechanize got one
This commit is contained in:
parent
92fde1d8de
commit
a570d40f70
@ -3,17 +3,16 @@ require "mechanize"
|
||||
module Webrat
|
||||
class MechanizeSession < Session
|
||||
|
||||
attr_accessor :response
|
||||
alias :page :response
|
||||
|
||||
def initialize(mechanize = WWW::Mechanize.new)
|
||||
super()
|
||||
@mechanize = mechanize
|
||||
end
|
||||
|
||||
def page
|
||||
@mechanize_page
|
||||
end
|
||||
|
||||
def get(url, data, headers_argument_not_used = nil)
|
||||
@mechanize_page = @mechanize.get(url, data)
|
||||
@response = @mechanize.get(url, data)
|
||||
end
|
||||
|
||||
def post(url, data, headers_argument_not_used = nil)
|
||||
@ -26,15 +25,15 @@ module Webrat
|
||||
end
|
||||
memo
|
||||
end
|
||||
@mechanize_page = @mechanize.post(url, post_data)
|
||||
@response = @mechanize.post(url, post_data)
|
||||
end
|
||||
|
||||
def response_body
|
||||
@mechanize_page.content
|
||||
@response.content
|
||||
end
|
||||
|
||||
def response_code
|
||||
@mechanize_page.code.to_i
|
||||
@response.code.to_i
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user