File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -670,4 +670,66 @@ describe('models', function () {
670
670
}
671
671
} ) ;
672
672
} ) ;
673
+
674
+ it ( 'should do something' , function ( done ) {
675
+ var spec = {
676
+ swagger : '2.0' ,
677
+ paths : {
678
+ '/bar' : {
679
+ post : {
680
+ operationId : 'thePOST' ,
681
+ parameters : [ ] ,
682
+ responses : {
683
+ 200 : {
684
+ description : 'OK' ,
685
+ schema : {
686
+ $ref : '#/definitions/A'
687
+ } ,
688
+ examples : {
689
+ A : {
690
+ status : 'Winning!'
691
+ }
692
+ }
693
+ }
694
+ }
695
+ } ,
696
+ put : {
697
+ operationId : 'thePUT' ,
698
+ parameters : [ ] ,
699
+ responses : {
700
+ 200 : {
701
+ description : 'OK' ,
702
+ schema : {
703
+ $ref : '#/definitions/A'
704
+ } ,
705
+ examples : {
706
+ B : {
707
+ status : 'Losing!'
708
+ }
709
+ }
710
+ }
711
+ }
712
+ }
713
+ }
714
+ } ,
715
+ definitions : {
716
+ A : {
717
+ properties : {
718
+ severity : {
719
+ type : 'string'
720
+ }
721
+ }
722
+ }
723
+ }
724
+ } ;
725
+
726
+ new SwaggerClient ( {
727
+ spec : spec ,
728
+ usePromise : true
729
+ } ) . then ( function ( client ) {
730
+ expect ( client . apisArray [ 0 ] . operationsArray [ 0 ] . successResponse [ '200' ] . name ) . toEqual ( 'A' ) ;
731
+ expect ( client . apisArray [ 0 ] . operationsArray [ 1 ] . successResponse [ '200' ] . name ) . toEqual ( 'B' ) ;
732
+ done ( ) ;
733
+ } )
734
+ } )
673
735
} ) ;
You can’t perform that action at this time.
0 commit comments