1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #39740 from khustochka/fix-symbol

Fix path_parameters key type inconsistency in ActionController::TestCase
This commit is contained in:
Eugene Kenny 2020-07-26 13:34:52 +01:00 committed by GitHub
commit e2cc2d1dfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -91,7 +91,7 @@ module ActionController
end end
end end
path_parameters[key] = value path_parameters[key.to_sym] = value
end end
end end

View file

@ -613,6 +613,12 @@ XML
assert_equal({ "bar" => [] }, JSON.load(response.body)["foo"]) assert_equal({ "bar" => [] }, JSON.load(response.body)["foo"])
end end
def test_using_as_json_with_path_parameters
post :test_params, params: { id: "12345" }, as: :json
assert_equal("12345", @request.path_parameters[:id])
end
def test_mutating_content_type_headers_for_plain_text_files_sets_the_header def test_mutating_content_type_headers_for_plain_text_files_sets_the_header
@request.headers["Content-Type"] = "text/plain" @request.headers["Content-Type"] = "text/plain"
post :render_body, params: { name: "foo.txt" } post :render_body, params: { name: "foo.txt" }