Skip to content

Commit c2931c7

Browse files
committed
1 parent c4a4d5a commit c2931c7

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

test/models.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,4 +670,66 @@ describe('models', function () {
670670
}
671671
});
672672
});
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+
})
673735
});

0 commit comments

Comments
 (0)