Merge pull request #15 from simplymeasured/add-test-for-scenario-where-semicolon-in-parameter-value-gets-silently-converted-to-ampersand

Add test to ensure semicolon in parameter value doesn't get converted to semicolon.
This commit is contained in:
Bob Aman 2012-11-17 22:34:32 -08:00
commit 0b31876250
1 changed files with 17 additions and 0 deletions

View File

@ -214,6 +214,23 @@ describe Google::APIClient do
conn.verify
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
pending("This is caused by Faraday's encoding of query parameters.")
conn = stub_connection do |stub|