diff options
Diffstat (limited to 'test/net/http/test_http.rb')
-rw-r--r-- | test/net/http/test_http.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index 9a7a149702..660c0ffa7c 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -147,22 +147,30 @@ module TestNetHTTP_version_1_1_methods end def test_s_post_form + url = "http://#{config('host')}:#{config('port')}/" res = Net::HTTP.post_form( - URI.parse("http://#{config('host')}:#{config('port')}/"), + URI.parse(url), "a" => "x") assert_equal ["a=x"], res.body.split(/[;&]/).sort res = Net::HTTP.post_form( - URI.parse("http://#{config('host')}:#{config('port')}/"), + URI.parse(url), "a" => "x", "b" => "y") assert_equal ["a=x", "b=y"], res.body.split(/[;&]/).sort res = Net::HTTP.post_form( - URI.parse("http://#{config('host')}:#{config('port')}/"), + URI.parse(url), "a" => ["x1", "x2"], "b" => "y") + assert_equal url, res['X-request-uri'] assert_equal ["a=x1", "a=x2", "b=y"], res.body.split(/[;&]/).sort + + res = Net::HTTP.post_form( + URI.parse(url + '?a=x'), + "b" => "y") + assert_equal url + '?a=x', res['X-request-uri'] + assert_equal ["b=y"], res.body.split(/[;&]/).sort end def test_patch |