提交 edc0f271 编写于 作者: M Matthew Draper

Merge pull request #15537 from tgxworld/fix_state_leak

Fix state leak.
...@@ -593,7 +593,6 @@ def process(action, http_method = 'GET', *args) ...@@ -593,7 +593,6 @@ def process(action, http_method = 'GET', *args)
unless @controller.respond_to?(:recycle!) unless @controller.respond_to?(:recycle!)
@controller.extend(Testing::Functional) @controller.extend(Testing::Functional)
@controller.class.class_eval { include Testing }
end end
@request.recycle! @request.recycle!
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
module BareMetalTest module BareMetalTest
class BareController < ActionController::Metal class BareController < ActionController::Metal
include ActionController::RackDelegation
def index def index
self.response_body = "Hello world" self.response_body = "Hello world"
end end
......
...@@ -242,6 +242,8 @@ class MetalTestController < ActionController::Metal ...@@ -242,6 +242,8 @@ class MetalTestController < ActionController::Metal
include AbstractController::Rendering include AbstractController::Rendering
include ActionView::Rendering include ActionView::Rendering
include ActionController::Rendering include ActionController::Rendering
include ActionController::RackDelegation
def accessing_logger_in_template def accessing_logger_in_template
render :inline => "<%= logger.class %>" render :inline => "<%= logger.class %>"
...@@ -387,10 +389,6 @@ def test_last_modified_works_with_less_than_too ...@@ -387,10 +389,6 @@ def test_last_modified_works_with_less_than_too
class EtagRenderTest < ActionController::TestCase class EtagRenderTest < ActionController::TestCase
tests TestControllerWithExtraEtags tests TestControllerWithExtraEtags
def setup
super
end
def test_multiple_etags def test_multiple_etags
@request.if_none_match = etag(["123", 'ab', :cde, [:f]]) @request.if_none_match = etag(["123", 'ab', :cde, [:f]])
get :fresh get :fresh
......
...@@ -9,6 +9,7 @@ def file_data() @data ||= File.open(file_path, 'rb') { |f| f.read } end ...@@ -9,6 +9,7 @@ def file_data() @data ||= File.open(file_path, 'rb') { |f| f.read } end
class SendFileController < ActionController::Base class SendFileController < ActionController::Base
include TestFileUtils include TestFileUtils
include ActionController::Testing
layout "layouts/standard" # to make sure layouts don't interfere layout "layouts/standard" # to make sure layouts don't interfere
attr_writer :options attr_writer :options
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册