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

Test that ActionDispatch::IntegrationTest does not leak parameters

This commit is contained in:
Nick Sieger 2016-07-28 14:12:55 -05:00
parent 407583478a
commit 273a691dfd

View file

@ -625,6 +625,20 @@ class IntegrationProcessTest < ActionDispatch::IntegrationTest
end
end
def test_post_then_get_with_parameters_do_not_leak_across_requests
with_test_route_set do
post '/post', params: { leaks: "does-leak?" }
get '/get_with_params', params: { foo: "bar" }
assert request.env['rack.input'].string.empty?
assert_equal 'foo=bar', request.env["QUERY_STRING"]
assert_equal 'foo=bar', request.query_string
assert_equal 'bar', request.parameters['foo']
assert request.parameters['leaks'].nil?
end
end
def test_head
with_test_route_set do
head '/get'