diff options
author | grosser <grosser.michael@gmail.com> | 2012-09-22 19:36:45 -0700 |
---|---|---|
committer | grosser <grosser.michael@gmail.com> | 2012-09-24 17:24:18 -0700 |
commit | 9e2948e750fa3f641f20adad4b4ecae89b35faa7 (patch) | |
tree | fb7809b1bf5cf07c815568153570eb1fa95301b5 /actionpack/test | |
parent | 133d42bc0fe4926800ff91a587e2ebeb405c3a11 (diff) | |
download | rails-9e2948e750fa3f641f20adad4b4ecae89b35faa7.tar.gz rails-9e2948e750fa3f641f20adad4b4ecae89b35faa7.tar.bz2 rails-9e2948e750fa3f641f20adad4b4ecae89b35faa7.zip |
depreacte unused Mime::Type#verify_request? and Mime::Type.browser_generated_types
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/mime_type_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/dispatch/rack_test.rb | 12 |
2 files changed, 13 insertions, 7 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 3e83f3d4fa..e2a9ba782d 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -185,9 +185,11 @@ class MimeTypeTest < ActiveSupport::TestCase all_types.uniq! # Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE all_types.delete_if { |type| !Mime.const_defined?(type.upcase) } - verified, unverified = all_types.partition { |type| Mime::Type.browser_generated_types.include? type } - assert verified.each { |type| assert Mime.const_get(type.upcase).verify_request?, "Verifiable Mime Type is not verified: #{type.inspect}" } - assert unverified.each { |type| assert !Mime.const_get(type.upcase).verify_request?, "Nonverifiable Mime Type is verified: #{type.inspect}" } + assert_deprecated do + verified, unverified = all_types.partition { |type| Mime::Type.browser_generated_types.include? type } + assert verified.each { |type| assert Mime.const_get(type.upcase).verify_request?, "Verifiable Mime Type is not verified: #{type.inspect}" } + assert unverified.each { |type| assert !Mime.const_get(type.upcase).verify_request?, "Nonverifiable Mime Type is verified: #{type.inspect}" } + end end test "references gives preference to symbols before strings" do diff --git a/actionpack/test/dispatch/rack_test.rb b/actionpack/test/dispatch/rack_test.rb index 698f980296..6d239d0a0c 100644 --- a/actionpack/test/dispatch/rack_test.rb +++ b/actionpack/test/dispatch/rack_test.rb @@ -176,13 +176,17 @@ end class RackRequestContentTypeTest < BaseRackTest test "html content type verification" do - @request.env['CONTENT_TYPE'] = Mime::HTML.to_s - assert @request.content_mime_type.verify_request? + assert_deprecated do + @request.env['CONTENT_TYPE'] = Mime::HTML.to_s + assert @request.content_mime_type.verify_request? + end end test "xml content type verification" do - @request.env['CONTENT_TYPE'] = Mime::XML.to_s - assert !@request.content_mime_type.verify_request? + assert_deprecated do + @request.env['CONTENT_TYPE'] = Mime::XML.to_s + assert !@request.content_mime_type.verify_request? + end end end |