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:
commit
e2cc2d1dfc
2 changed files with 7 additions and 1 deletions
|
@ -91,7 +91,7 @@ module ActionController
|
|||
end
|
||||
end
|
||||
|
||||
path_parameters[key] = value
|
||||
path_parameters[key.to_sym] = value
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -613,6 +613,12 @@ XML
|
|||
assert_equal({ "bar" => [] }, JSON.load(response.body)["foo"])
|
||||
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
|
||||
@request.headers["Content-Type"] = "text/plain"
|
||||
post :render_body, params: { name: "foo.txt" }
|
||||
|
|
Loading…
Reference in a new issue