Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
core expects a response so mechanize got one
  • Loading branch information
Jeremy Burks committed Nov 12, 2008
1 parent 92fde1d commit a570d40
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/webrat/mechanize.rb
Expand Up @@ -3,17 +3,16 @@
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)
Expand All @@ -26,15 +25,15 @@ def post(url, data, headers_argument_not_used = nil)
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
Expand Down

0 comments on commit a570d40

Please sign in to comment.