Minor cleanup on tests
This commit is contained in:
parent
664e21290a
commit
35c38a1ce8
|
@ -218,10 +218,7 @@ describe Google::APIClient do
|
||||||
it 'should generate valid requests when multivalued parameters are passed' do
|
it 'should generate valid requests when multivalued parameters are passed' do
|
||||||
conn = stub_connection do |stub|
|
conn = stub_connection do |stub|
|
||||||
stub.post('/prediction/v1.2/training?data=1&data=2') do |env|
|
stub.post('/prediction/v1.2/training?data=1&data=2') do |env|
|
||||||
# Test is now passing with Faraday 0.9.0.rc1, but small bug in test adapter
|
env.params['data'].should include('1', '2')
|
||||||
#params = env[:params]
|
|
||||||
params = Faraday::FlatParamsEncoder.decode(env.url.query)
|
|
||||||
params['data'].should include('1', '2')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
request = CLIENT.execute(
|
request = CLIENT.execute(
|
||||||
|
|
|
@ -36,7 +36,7 @@ shared_examples_for 'configurable user agent' do
|
||||||
it 'should not allow the user agent to be used with bogus values' do
|
it 'should not allow the user agent to be used with bogus values' do
|
||||||
(lambda do
|
(lambda do
|
||||||
client.user_agent = 42
|
client.user_agent = 42
|
||||||
client.execute(:uri=>'http://www.google.com/')
|
client.execute(:uri=>'https://www.google.com/')
|
||||||
end).should raise_error(TypeError)
|
end).should raise_error(TypeError)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ shared_examples_for 'configurable user agent' do
|
||||||
[200, {}, ['']]
|
[200, {}, ['']]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
client.execute(:uri=>'http://www.google.com/', :connection => conn)
|
client.execute(:uri=>'https://www.google.com/', :connection => conn)
|
||||||
conn.verify
|
conn.verify
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue