mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #1877 from arunagw/fix_mime
Fix test to use Mime::Zip
This commit is contained in:
@@ -21,9 +21,6 @@ Mime::Type.register "application/rss+xml", :rss
|
||||
Mime::Type.register "application/atom+xml", :atom
|
||||
Mime::Type.register "application/x-yaml", :yaml, %w( text/yaml )
|
||||
|
||||
Mime::Type.register "application/pdf", :pdf, [], %w(pdf)
|
||||
Mime::Type.register "application/zip", :zip, [], %w(zip)
|
||||
|
||||
Mime::Type.register "multipart/form-data", :multipart_form
|
||||
Mime::Type.register "application/x-www-form-urlencoded", :url_encoded_form
|
||||
|
||||
@@ -31,5 +28,8 @@ Mime::Type.register "application/x-www-form-urlencoded", :url_encoded_form
|
||||
# http://www.json.org/JSONRequest.html
|
||||
Mime::Type.register "application/json", :json, %w( text/x-json application/jsonrequest )
|
||||
|
||||
Mime::Type.register "application/pdf", :pdf, [], %w(pdf)
|
||||
Mime::Type.register "application/zip", :zip, [], %w(zip)
|
||||
|
||||
# Create Mime::ALL but do not add it to the SET.
|
||||
Mime::ALL = Mime::Type.new("*/*", :all, [])
|
||||
|
||||
@@ -52,7 +52,7 @@ class MimeTypeTest < ActiveSupport::TestCase
|
||||
|
||||
test "parse application with trailing star" do
|
||||
accept = "application/*"
|
||||
expect = [Mime::HTML, Mime::JS, Mime::XML, Mime::RSS, Mime::ATOM, Mime::YAML, Mime::URL_ENCODED_FORM, Mime::JSON, Mime::PDF]
|
||||
expect = [Mime::HTML, Mime::JS, Mime::XML, Mime::RSS, Mime::ATOM, Mime::YAML, Mime::URL_ENCODED_FORM, Mime::JSON, Mime::PDF, Mime::ZIP]
|
||||
parsed = Mime::Type.parse(accept)
|
||||
assert_equal expect, parsed
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user