Test for repeated parameters

This commit is contained in:
Martin Sarsale 2011-12-01 11:04:40 -03:00
parent f736ac4d97
commit ed4742d8d4
1 changed files with 10 additions and 1 deletions

View File

@ -174,7 +174,16 @@ describe Google::APIClient do
(headers.inject({}) { |h,(k,v)| h[k]=v; h }).should == {}
body.should respond_to(:each)
end
it 'should generate valid requests when repeated parameters are passed' do
request = @client.generate_request(
:api_method => @prediction.training.insert,
:parameters => [['data', '1'],['data','2']]
)
method, uri, headers, body = request
method.should == 'POST'
uri.should ==
'https://www.googleapis.com/prediction/v1.2/training?data=1&data=2'
end
it 'should generate requests against the correct URIs' do
request = @client.generate_request(
:api_method => @prediction.training.insert,