From a570d40f7056e977a4583a4baecb8444a7ffcce0 Mon Sep 17 00:00:00 2001 From: Jeremy Burks Date: Tue, 11 Nov 2008 20:08:17 -0600 Subject: [PATCH] core expects a response so mechanize got one --- lib/webrat/mechanize.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/webrat/mechanize.rb b/lib/webrat/mechanize.rb index e60b020..77d0f77 100644 --- a/lib/webrat/mechanize.rb +++ b/lib/webrat/mechanize.rb @@ -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