From 27f3619cd5d3700b2ff16f7c153c3549316b9410 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Sat, 17 Dec 2011 07:52:42 -0500 Subject: Add test for register_alias --- actionpack/test/dispatch/mime_type_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 5415097e44..db21080c42 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -117,6 +117,15 @@ class MimeTypeTest < ActiveSupport::TestCase end end + test "register alias" do + begin + Mime::Type.register_alias "application/xhtml+xml", :foobar + assert_equal Mime::HTML, Mime::EXTENSION_LOOKUP['foobar'] + ensure + Mime::Type.unregister(:FOOBAR) + end + end + test "type should be equal to symbol" do assert_equal Mime::HTML, 'application/xhtml+xml' assert_equal Mime::HTML, :html -- cgit v1.2.3