Add test for scenario where semicolon in parameter value gets silently converted to ampersand

This commit is contained in:
Ryan Biesemeyer 2012-11-18 06:22:25 +00:00
parent b0b03cc363
commit 0211d4b6d3
1 changed files with 17 additions and 0 deletions

View File

@ -214,6 +214,23 @@ describe Google::APIClient do
conn.verify conn.verify
end end
it 'should generate valid requests when parameter value includes semicolon' do
conn = stub_connection do |stub|
# semicolon (;) in parameter value was being converted to
# bare ampersand (&) in 0.4.7. ensure that it gets converted
# to a CGI-escaped semicolon (%3B) instead.
stub.post('/prediction/v1.2/training?data=12345%3B67890') do |env|
env[:body].should == ''
end
end
request = CLIENT.execute(
:api_method => @prediction.training.insert,
:parameters => {'data' => '12345;67890'},
:connection => conn
)
conn.verify
end
it 'should generate valid requests when repeated parameters are passed' do it 'should generate valid requests when repeated parameters are passed' do
pending("This is caused by Faraday's encoding of query parameters.") pending("This is caused by Faraday's encoding of query parameters.")
conn = stub_connection do |stub| conn = stub_connection do |stub|