Skip to content

Commit af94934

Browse files
committed
1 parent 7460d97 commit af94934

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

test/help.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,38 @@ describe('help options', function () {
262262
});
263263
});
264264

265-
it('handles delete form', function (done) {
265+
it('handles delete form with parameters', function (done) {
266+
var spec = {
267+
paths: {
268+
'/foo': {
269+
delete: {
270+
tags: [ 'test' ],
271+
operationId: 'sample',
272+
consumes: [ 'application/x-www-form-urlencoded' ],
273+
parameters: [
274+
{
275+
in: 'formData',
276+
name: 'name',
277+
type: 'string'
278+
}
279+
]
280+
}
281+
}
282+
}
283+
};
284+
285+
var client = new SwaggerClient({
286+
url: 'http://localhost:8080/petstore.yaml',
287+
spec: spec,
288+
success: function () {
289+
var msg = client.test.sample.asCurl({name: 'fred'});
290+
expect(msg).toBe("curl -X DELETE --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'name=fred' 'http://localhost:8080/foo'");
291+
done();
292+
}
293+
});
294+
});
295+
296+
it('handles delete form with no parameters', function (done) {
266297
var spec = {
267298
paths: {
268299
'/foo': {

0 commit comments

Comments
 (0)