diff options
author | Justin Campbell <justin@justincampbell.me> | 2011-12-17 07:40:54 -0500 |
---|---|---|
committer | Justin Campbell <justin@justincampbell.me> | 2011-12-17 07:40:54 -0500 |
commit | a87690b02c0d1b4387974114625696e7e113080f (patch) | |
tree | e51e5f1f7277f78a1c2eb16148dae114a649ed15 /actionpack | |
parent | 4d5266e2706195888c9f72fdc9ebde22f89a08df (diff) | |
download | rails-a87690b02c0d1b4387974114625696e7e113080f.tar.gz rails-a87690b02c0d1b4387974114625696e7e113080f.tar.bz2 rails-a87690b02c0d1b4387974114625696e7e113080f.zip |
Add test for type aliases
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/dispatch/mime_type_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 7a94b188ce..5415097e44 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -95,6 +95,17 @@ class MimeTypeTest < ActiveSupport::TestCase end end + test "custom type with type aliases" do + begin + Mime::Type.register "text/foobar", :foobar, ["text/foo", "text/bar"] + %w[text/foobar text/foo text/bar].each do |type| + assert_equal Mime::FOOBAR, type + end + ensure + Mime::Type.unregister(:FOOBAR) + end + end + test "custom type with extension aliases" do begin Mime::Type.register "text/foobar", :foobar, [], [:foo, "bar"] |