aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Campbell <justin@justincampbell.me>2011-12-17 07:52:42 -0500
committerJustin Campbell <justin@justincampbell.me>2011-12-17 07:52:47 -0500
commit27f3619cd5d3700b2ff16f7c153c3549316b9410 (patch)
treefbac2f188a2639f16905d25352b36c50c930ab95
parenta87690b02c0d1b4387974114625696e7e113080f (diff)
downloadrails-27f3619cd5d3700b2ff16f7c153c3549316b9410.tar.gz
rails-27f3619cd5d3700b2ff16f7c153c3549316b9410.tar.bz2
rails-27f3619cd5d3700b2ff16f7c153c3549316b9410.zip
Add test for register_alias
-rw-r--r--actionpack/test/dispatch/mime_type_test.rb9
1 files changed, 9 insertions, 0 deletions
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