2008-11-25 00:59:27 +00:00
|
|
|
module Webrat #:nodoc:
|
|
|
|
def self.session_class #:nodoc:
|
2008-11-23 05:22:49 +00:00
|
|
|
TestSession
|
|
|
|
end
|
2008-12-30 02:19:13 +00:00
|
|
|
|
2008-11-25 00:59:27 +00:00
|
|
|
class TestSession < Session #:nodoc:
|
2008-05-12 03:58:20 +00:00
|
|
|
attr_accessor :response_body
|
|
|
|
attr_writer :response_code
|
2008-12-30 02:19:13 +00:00
|
|
|
|
2008-05-12 04:58:24 +00:00
|
|
|
def doc_root
|
|
|
|
File.expand_path(File.join(".", "public"))
|
|
|
|
end
|
2008-12-30 02:19:13 +00:00
|
|
|
|
2008-11-07 04:08:46 +00:00
|
|
|
def response
|
2008-12-30 02:19:13 +00:00
|
|
|
@response ||= TestResponse.new
|
2008-11-07 04:08:46 +00:00
|
|
|
end
|
2008-12-30 02:19:13 +00:00
|
|
|
|
2008-05-12 03:58:20 +00:00
|
|
|
def response_code
|
|
|
|
@response_code || 200
|
|
|
|
end
|
2008-12-30 02:19:13 +00:00
|
|
|
|
|
|
|
def get(url, data, headers = nil)
|
|
|
|
end
|
|
|
|
|
|
|
|
def post(url, data, headers = nil)
|
2008-05-12 03:58:20 +00:00
|
|
|
end
|
2008-12-30 02:19:13 +00:00
|
|
|
|
|
|
|
def put(url, data, headers = nil)
|
2008-05-12 03:58:20 +00:00
|
|
|
end
|
2008-12-30 02:19:13 +00:00
|
|
|
|
|
|
|
def delete(url, data, headers = nil)
|
2008-05-12 03:58:20 +00:00
|
|
|
end
|
2008-12-30 02:19:13 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
class TestResponse #:nodoc:
|
|
|
|
def redirect?
|
|
|
|
false
|
2008-05-12 03:58:20 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|