Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #15529 from zuhao/refactor_actionpack_mime_type_test

Make sure Mime::Type is not altered after tests.
  • Loading branch information...
commit da19e0d13298bc31051e9c67b5eda206413ae0dc 2 parents e496a25 + 1bcde3a
@senny senny authored
View
6 actionpack/test/controller/send_file_test.rb
@@ -33,17 +33,11 @@ class SendFileTest < ActionController::TestCase
include TestFileUtils
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
View
2  actionpack/test/dispatch/mime_type_test.rb
@@ -1,8 +1,6 @@
require 'abstract_unit'
class MimeTypeTest < ActiveSupport::TestCase
- Mime::Type.register "image/png", :png unless defined? Mime::PNG
- Mime::Type.register "application/pdf", :pdf unless defined? Mime::PDF
test "parse single" do
Mime::LOOKUP.keys.each do |mime_type|
Please sign in to comment.
Something went wrong with that request. Please try again.