提交 13a5cc33 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #25123 from bf4/remove_problematic_mime_test

Modifies mime-registration test not to interfere with real mime types
......@@ -155,7 +155,7 @@ def teardown
test "parses json params after custom json mime type registered" do
begin
Mime::Type.unregister :json
Mime::Type.register "application/json", :json, %w(application/vnd.api+json)
Mime::Type.register "application/json", :json, %w(application/vnd.rails+json)
assert_parses(
{"user" => {"username" => "meinac"}, "username" => "meinac"},
"{\"username\": \"meinac\"}", { 'CONTENT_TYPE' => 'application/json' }
......@@ -169,10 +169,10 @@ def teardown
test "parses json params after custom json mime type registered with synonym" do
begin
Mime::Type.unregister :json
Mime::Type.register "application/json", :json, %w(application/vnd.api+json)
Mime::Type.register "application/json", :json, %w(application/vnd.rails+json)
assert_parses(
{"user" => {"username" => "meinac"}, "username" => "meinac"},
"{\"username\": \"meinac\"}", { 'CONTENT_TYPE' => 'application/vnd.api+json' }
"{\"username\": \"meinac\"}", { 'CONTENT_TYPE' => 'application/vnd.rails+json' }
)
ensure
Mime::Type.unregister :json
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册