aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRonak Jangir <ronakjangir47@gmail.com>2015-09-27 14:10:57 +0530
committerRonak Jangir <ronakjangir47@gmail.com>2015-09-27 14:15:17 +0530
commit4b4249fa7efd5862cbda9ff889c9d56ae3338d0a (patch)
tree726f98240e286526ead2b16726dc4f6418b8d673 /actionpack/test
parent210f33c477e950ad44e66b47da794469ce3b5e64 (diff)
downloadrails-4b4249fa7efd5862cbda9ff889c9d56ae3338d0a.tar.gz
rails-4b4249fa7efd5862cbda9ff889c9d56ae3338d0a.tar.bz2
rails-4b4249fa7efd5862cbda9ff889c9d56ae3338d0a.zip
Added test case for deprecation of Mime.const_defined? and removed use of it.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/mime_type_test.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb
index 91f6f66fe3..68083ed747 100644
--- a/actionpack/test/dispatch/mime_type_test.rb
+++ b/actionpack/test/dispatch/mime_type_test.rb
@@ -18,7 +18,7 @@ class MimeTypeTest < ActiveSupport::TestCase
assert_equal Mime::Type[:MOBILE], Mime::EXTENSION_LOOKUP['mobile']
Mime::Type.unregister(:mobile)
- assert !Mime.const_defined?(:MOBILE), "Mime::MOBILE should not be defined"
+ assert !Mime::Type.registered?(:MOBILE), "Mime::MOBILE should not be defined"
assert !Mime::LOOKUP.has_key?('text/x-mobile'), "Mime::LOOKUP should not have key ['text/x-mobile]"
assert !Mime::EXTENSION_LOOKUP.has_key?('mobile'), "Mime::EXTENSION_LOOKUP should not have key ['mobile]"
ensure
@@ -183,6 +183,10 @@ class MimeTypeTest < ActiveSupport::TestCase
end
end
+ test "deprecated const_defined?" do
+ assert_deprecated { Mime.const_defined?(:ALL) }
+ end
+
test "verifiable mime types" do
all_types = Mime::SET.symbols
all_types.uniq!