From 9e2948e750fa3f641f20adad4b4ecae89b35faa7 Mon Sep 17 00:00:00 2001 From: grosser Date: Sat, 22 Sep 2012 19:36:45 -0700 Subject: depreacte unused Mime::Type#verify_request? and Mime::Type.browser_generated_types --- actionpack/test/dispatch/mime_type_test.rb | 8 +++++--- actionpack/test/dispatch/rack_test.rb | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'actionpack/test/dispatch') 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 -- cgit v1.2.3