aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2014-05-28 12:00:35 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2014-05-28 12:00:35 -0300
commit9ae3f5ff1c63209ecc2b79caa7a7d08582dfe322 (patch)
tree96266295009599f9cc76408ca3acd67b98751892 /actionpack/test
parentc711c90bae821a57523d99b526b22e84a1562ead (diff)
parent35cc73e79d352430c140964570a0a6df727d1097 (diff)
downloadrails-9ae3f5ff1c63209ecc2b79caa7a7d08582dfe322.tar.gz
rails-9ae3f5ff1c63209ecc2b79caa7a7d08582dfe322.tar.bz2
rails-9ae3f5ff1c63209ecc2b79caa7a7d08582dfe322.zip
Merge pull request #15388 from zuhao/refactor_actionpack_send_file_test
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