aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorZuhao Wan <wanzuhao@gmail.com>2014-05-28 22:54:12 +0800
committerZuhao Wan <wanzuhao@gmail.com>2014-05-28 22:54:12 +0800
commit35cc73e79d352430c140964570a0a6df727d1097 (patch)
treebf263b3b46b2b0bc9f0238db5f7644502a885f7c /actionpack/test
parentb22b1882238b08ed341bebc32335b6b6f6f64dfb (diff)
downloadrails-35cc73e79d352430c140964570a0a6df727d1097.tar.gz
rails-35cc73e79d352430c140964570a0a6df727d1097.tar.bz2
rails-35cc73e79d352430c140964570a0a6df727d1097.zip
Unregister Mime::Type in teardown.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/send_file_test.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index aee139b95e..2c833aa2e5 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -32,14 +32,18 @@ end
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