提交 9ae3f5ff 编写于 作者: S Santiago Pastorino

Merge pull request #15388 from zuhao/refactor_actionpack_send_file_test

Unregister Mime::Type in teardown.
......@@ -32,14 +32,18 @@ class SendFileWithActionControllerLive < SendFileController
class SendFileTest < ActionController::TestCase
include TestFileUtils
Mime::Type.register "image/png", :png unless defined? Mime::PNG
def setup
@mime_type_defined = defined? Mime::PNG
Mime::Type.register "image/png", :png unless @mime_type_defined
@controller = SendFileController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
teardown do
Mime::Type.unregister :png unless @mime_type_defined
end
def test_file_nostream
@controller.options = { :stream => false }
response = nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册