diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-01 17:26:46 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-01 17:26:46 -0500 |
commit | 12288a034120e8b1f90fcd4ae5881a858fd1425e (patch) | |
tree | cea73e54bc6266b8d949ee421c68336d1e50da49 /actionpack/test | |
parent | 926f4648f0628009336c44f4d31019819434e39c (diff) | |
parent | f48e89931f3dfe0571f62f926c01cb7783814347 (diff) | |
download | rails-12288a034120e8b1f90fcd4ae5881a858fd1425e.tar.gz rails-12288a034120e8b1f90fcd4ae5881a858fd1425e.tar.bz2 rails-12288a034120e8b1f90fcd4ae5881a858fd1425e.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/mime_type_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime_type_test.rb b/actionpack/test/controller/mime_type_test.rb index 991ac04f62..03b0f8bad2 100644 --- a/actionpack/test/controller/mime_type_test.rb +++ b/actionpack/test/controller/mime_type_test.rb @@ -28,6 +28,13 @@ class MimeTypeTest < Test::Unit::TestCase expect = [Mime::HTML, Mime::XML, "image/*", Mime::TEXT, Mime::ALL] assert_equal expect, Mime::Type.parse(accept).collect { |c| c.to_s } end + + # Accept header send with user HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1) + def test_parse_crappy_broken_acceptlines2 + accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, , pronto/1.00.00, sslvpn/1.00.00.00, */*" + expect = ['image/gif', 'image/x-xbitmap', 'image/jpeg','image/pjpeg', 'application/x-shockwave-flash', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/msword', 'pronto/1.00.00', 'sslvpn/1.00.00.00', Mime::ALL ] + assert_equal expect, Mime::Type.parse(accept).collect { |c| c.to_s } + end def test_custom_type Mime::Type.register("image/gif", :gif) |