diff --git a/lib/google/api_client/service.rb b/lib/google/api_client/service.rb new file mode 100644 index 000000000..e69de29bb diff --git a/spec/google/api_client/discovery_spec.rb b/spec/google/api_client/discovery_spec.rb index 4eb7fca0c..3728e2c1e 100644 --- a/spec/google/api_client/discovery_spec.rb +++ b/spec/google/api_client/discovery_spec.rb @@ -550,7 +550,6 @@ describe Google::APIClient do end it 'should succeed when validating repeated parameters in a correct call' do -# pending("This is caused by Faraday's encoding of query parameters.") conn = stub_connection do |stub| stub.get('/adsense/v1.3/reports?dimension=DATE&dimension=PRODUCT_CODE'+ '&endDate=2010-01-01&metric=CLICKS&metric=PAGE_VIEWS&'+ @@ -587,6 +586,29 @@ describe Google::APIClient do ) end).should raise_error(ArgumentError) end + + it 'should generate valid requests when multivalued parameters are passed' do + conn = stub_connection do |stub| + stub.get('/adsense/v1.3/reports?dimension=DATE&dimension=PRODUCT_CODE'+ + '&endDate=2010-01-01&metric=CLICKS&metric=PAGE_VIEWS&'+ + 'startDate=2000-01-01') do |env| + env.params['dimension'].should include('DATE', 'PRODUCT_CODE') + env.params['metric'].should include('CLICKS', 'PAGE_VIEWS') + end + end + request = CLIENT.execute( + :api_method => @adsense.reports.generate, + :parameters => { + 'startDate' => '2000-01-01', + 'endDate' => '2010-01-01', + 'dimension' => ['DATE', 'PRODUCT_CODE'], + 'metric' => ['PAGE_VIEWS', 'CLICKS'] + }, + :authenticated => false, + :connection => conn + ) + conn.verify + end end describe 'with the Drive API' do