Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Jun 16, 2016
1 parent 12ec38c commit 6f603bf
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,4 +428,35 @@ describe('help options', function () {
}
});
});

it('has brackets in variables', function (done) {
var spec = {
paths: {
'/foo': {
post: {
tags: [ 'test' ],
operationId: 'sample',
parameters: [
{
in: 'query',
name: 'fields',
type: 'string'
}
]
}
}
}
};

var client = new SwaggerClient({
url: 'http://localhost:8080/petstore.yaml',
spec: spec,
success: function () {
var msg = client.test.sample.asCurl({fields: '[articles]=title'});
expect(msg).toBe("curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://localhost:8080/foo?fields=%5Barticles%5D%3Dtitle'");

done();
}
});
});
});

0 comments on commit 6f603bf

Please sign in to comment.