add test to prove the response body isn't part of the output

This commit is contained in:
Art Lowel
2019-12-17 09:58:05 +01:00
parent de6abb7ce6
commit 907358edc5

View File

@@ -11,6 +11,17 @@ describe('StatusCodeOnlyResponseParsingService', () => {
describe('parse', () => { describe('parse', () => {
it('should return a RestResponse that doesn\'t contain the response body', () => {
const payload = 'd9128e44-183b-479d-aa2e-d39435838bf6';
const result = service.parse(undefined, {
payload,
statusCode: 201,
statusText: '201'
});
expect(JSON.stringify(result).indexOf(payload)).toBe(-1);
});
describe('when the response is successful', () => { describe('when the response is successful', () => {
beforeEach(() => { beforeEach(() => {
statusCode = 201; statusCode = 201;