Fixed issue with header/options ambiguity.

This commit is contained in:
Bob Aman committed 2011-08-02 16:20:54 -04:00
1 parent a281c1bcf5
commit 0d2cbe26df
2 files changed
+18 -8

No files matched your search

+14
View File
@@ -14,6 +14,7 @@
require 'spec_helper'
require 'json'
require 'signet/oauth_1/client'
require 'httpadapter/adapters/net_http'
@@ -238,6 +239,19 @@ describe Google::APIClient do
)
end).should raise_error(Google::APIClient::ClientError)
end
it 'should correctly handle unnamed parameters' do
@client.authorization = :oauth_2
@client.authorization.access_token = '12345'
result = @client.execute(
@prediction.training.insert,
{},
JSON.generate({"id" => "bucket/object"}),
{'Content-Type' => 'application/json'}
)
method, uri, headers, body = result.request
Hash[headers]['Content-Type'].should == 'application/json'
end
end
describe 'with the buzz API' do