diff options
author | Justin Campbell <justin@justincampbell.me> | 2011-12-17 07:39:52 -0500 |
---|---|---|
committer | Justin Campbell <justin@justincampbell.me> | 2011-12-17 07:40:25 -0500 |
commit | 4d5266e2706195888c9f72fdc9ebde22f89a08df (patch) | |
tree | d692c3bf08334ef7af8a376d20f09ee07ad04842 /actionpack/test | |
parent | 4f35d5a18b1192f03c36b23b2f6a8b3b2d2c0347 (diff) | |
download | rails-4d5266e2706195888c9f72fdc9ebde22f89a08df.tar.gz rails-4d5266e2706195888c9f72fdc9ebde22f89a08df.tar.bz2 rails-4d5266e2706195888c9f72fdc9ebde22f89a08df.zip |
Allow symbols to be passed for extension aliases
Diffstat (limited to 'actionpack/test')
-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 08fe2127b9..7a94b188ce 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 extension aliases" do + begin + Mime::Type.register "text/foobar", :foobar, [], [:foo, "bar"] + %w[foobar foo bar].each do |extension| + assert_equal Mime::FOOBAR, Mime::EXTENSION_LOOKUP[extension] + end + 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 |