webrat/spec/fakes/test_session.rb

40 lines
658 B
Ruby
Raw Normal View History

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-11-25 00:59:27 +00:00
class TestSession < Session #:nodoc:
attr_accessor :response_body
attr_writer :response_code
def doc_root
File.expand_path(File.join(".", "public"))
end
def response
@response ||= TestResponse.new
end
def response_code
@response_code || 200
end
def get(url, data, headers = nil)
end
def post(url, data, headers = nil)
end
def put(url, data, headers = nil)
end
def delete(url, data, headers = nil)
end
end
class TestResponse #:nodoc:
def redirect?
false
end
end
end