File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -1650,10 +1650,46 @@ describe('SwaggerClient', function () {
16501650 } ) . then ( function ( client ) {
16511651 var mock = client . test . slash ( { } , { mock : true } ) ;
16521652 expect ( mock . url ) . toBe ( 'http://localhost:8000/double/foo?happy=' ) ;
1653-
16541653 done ( ) ;
16551654 } ) . catch ( function ( exception ) {
16561655 done ( exception ) ;
16571656 } ) ;
16581657 } ) ;
1658+
1659+ it ( 'passes data in a delete with formData' , function ( done ) {
1660+
1661+ var spec = {
1662+ paths : {
1663+ '/foo' : {
1664+ delete : {
1665+ tags : [
1666+ 'test'
1667+ ] ,
1668+ operationId : 'removeMe' ,
1669+ consumes : [
1670+ 'x-www-form-urlencoded'
1671+ ] ,
1672+ parameters : [ {
1673+ in : 'formData' ,
1674+ name : 'username' ,
1675+ type : 'string' ,
1676+ required : false
1677+ } ] ,
1678+ }
1679+ }
1680+ }
1681+ } ;
1682+ new SwaggerClient ( {
1683+ url : 'http://localhost:8000/v2/swagger.json' ,
1684+ spec : spec ,
1685+ usePromise : true
1686+ } ) . then ( function ( client ) {
1687+ var mock = client . test . removeMe ( { username : 'Tony' } , { mock : true } ) ;
1688+ expect ( mock . body ) . toBe ( 'username=Tony' ) ;
1689+ expect ( mock . headers [ 'Content-Type' ] ) . toBe ( 'application/x-www-form-urlencoded' ) ;
1690+ done ( ) ;
1691+ } ) . catch ( function ( exception ) {
1692+ done ( exception ) ;
1693+ } ) ;
1694+ } )
16591695} ) ;
You can’t perform that action at this time.
0 commit comments