Merge remote-tracking branch 'origin/master' into 2.3.0

This commit is contained in:
wing328
2017-06-26 23:39:04 +08:00
60 changed files with 182 additions and 179 deletions

View File

@@ -10,7 +10,7 @@ describe('ApiClient', function() {
describe('defaults', function() {
it('should have correct default values with the default API client', function() {
expect(apiClient).to.be.ok();
expect(apiClient.basePath).to.be('http://petstore.swagger.io/v2');
expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2');
expect(apiClient.authentications).to.eql({
petstore_auth: {type: 'oauth2'},
http_basic_test: {type: 'basic'},
@@ -45,8 +45,8 @@ describe('ApiClient', function() {
it('should have correct default values with new API client and can customize it', function() {
var newClient = new SwaggerPetstore.ApiClient;
expect(newClient.basePath).to.be('http://petstore.swagger.io/v2');
expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io/v2/abc');
expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2');
expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc');
newClient.basePath = 'http://example.com';
expect(newClient.basePath).to.be('http://example.com');
@@ -102,16 +102,16 @@ describe('ApiClient', function() {
describe('#buildUrl', function() {
it('should work without path parameters in the path', function() {
expect(apiClient.buildUrl('/abc', {})).to
.be('http://petstore.swagger.io/v2/abc');
.be('http://petstore.swagger.io:80/v2/abc');
expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to
.be('http://petstore.swagger.io/v2/abc/def?ok');
.be('http://petstore.swagger.io:80/v2/abc/def?ok');
});
it('should work with path parameters in the path', function() {
expect(apiClient.buildUrl('/{id}', {id: 123})).to
.be('http://petstore.swagger.io/v2/123');
.be('http://petstore.swagger.io:80/v2/123');
expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to.
be('http://petstore.swagger.io/v2/abc/456/a%20b?ok');
be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok');
});
});