提交 9f4dafb8 编写于 作者: A Aaron Patterson

push functional test specific methods to it's own module

上级 b5442b5a
......@@ -4,20 +4,22 @@ module Testing
include RackDelegation
def set_response!(request)
super unless @_response
end
def recycle!
@_url_options = nil
end
# TODO : Rewrite tests using controller.headers= to use Rack env
def headers=(new_headers)
@_response ||= ActionDispatch::Response.new
@_response.headers.replace(new_headers)
end
# Behavior specific to functional tests
module Functional # :nodoc:
def set_response!(request)
end
def recycle!
@_url_options = nil
end
end
module ClassMethods
def before_filters
_process_action_callbacks.find_all{|x| x.kind == :before}.map{|x| x.name}
......
......@@ -491,7 +491,11 @@ def process(action, http_method = 'GET', *args)
@controller.response = @response
build_request_uri(action, parameters)
@controller.class.class_eval { include Testing }
unless @controller.respond_to?(:recycle!)
@controller.extend(Testing::Functional)
@controller.class.class_eval { include Testing }
end
@controller.recycle!
name = @request.parameters[:action]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册