aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/mime_type_test.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb
index d9fb44f06d..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
@@ -154,10 +154,10 @@ class MimeTypeTest < ActiveSupport::TestCase
end
test "type convenience methods" do
- # Don't test Mime::ALL, since it Mime::ALL#html? == true
+ # Don't test Mime::Type[:ALL], since it Mime::Type[:ALL].html? == true
types = Mime::SET.symbols.uniq - [:all, :iphone]
- # Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE
+ # Remove custom Mime::Type instances set in other tests, like Mime::Type[:GIF] and Mime::Type[:IPHONE]
types.delete_if { |type| !Mime::Type.registered?(type.upcase) }
types.each do |type|
@@ -183,10 +183,14 @@ 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!
- # Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE
+ # Remove custom Mime::Type instances set in other tests, like Mime::Type[:GIF] and Mime::Type[:IPHONE]
all_types.delete_if { |type| !Mime::Type.registered?(type.upcase) }
end