diff options
author | José Valim <jose.valim@gmail.com> | 2010-11-28 22:40:32 +0100 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-08 14:14:26 -0800 |
commit | 6b1018526fb304727ee4191afc2d8a5e29e49eea (patch) | |
tree | 33e57e76341028a8bd42bf8cac33b038fbd3dcf2 /actionpack/test/dispatch | |
parent | b93c590297ba65a6c5b18655a7790163abcb06f1 (diff) | |
download | rails-6b1018526fb304727ee4191afc2d8a5e29e49eea.tar.gz rails-6b1018526fb304727ee4191afc2d8a5e29e49eea.tar.bz2 rails-6b1018526fb304727ee4191afc2d8a5e29e49eea.zip |
Use Mime::Type references.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/mime_type_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 9782f328fc..11cf68fdb3 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -131,6 +131,13 @@ class MimeTypeTest < ActiveSupport::TestCase assert unverified.each { |type| assert !Mime.const_get(type.to_s.upcase).verify_request?, "Nonverifiable Mime Type is verified: #{type.inspect}" } end + test "references gives preference to symbols before strings" do + assert_equal :html, Mime::HTML.ref + another = Mime::Type.lookup("foo/bar") + assert_nil another.to_sym + assert_equal "foo/bar", another.ref + end + test "regexp matcher" do assert Mime::JS =~ "text/javascript" assert Mime::JS =~ "application/javascript" |