From a771102f3f73a1bdf6dfdba261f97f4aea04a7a5 Mon Sep 17 00:00:00 2001 From: Markus Goerlich Date: Wed, 19 Apr 2017 11:29:28 +0200 Subject: [PATCH] fix(test): Fixed unit test close #41 --- integration-test/oauth-tooling/tokenCache.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/integration-test/oauth-tooling/tokenCache.spec.ts b/integration-test/oauth-tooling/tokenCache.spec.ts index 01de300..0cd0229 100644 --- a/integration-test/oauth-tooling/tokenCache.spec.ts +++ b/integration-test/oauth-tooling/tokenCache.spec.ts @@ -308,7 +308,9 @@ describe('tokenCache', () => { const secondAccessToken = '9sdf8fd8-be1d-4f0f-b4cb-54nk66n45knk'; nock(oauthHost) - .post('/access_token?realm=/services') + .post('/access_token?realm=/services', function (body: any) { + return body.scope === 'nucleus.write nucleus.read'; + }) .reply(HttpStatus.OK, { access_token: firstAccessToken }) @@ -322,7 +324,9 @@ describe('tokenCache', () => { 'uid': 'uid', 'access_token': firstAccessToken }) - .post('/access_token?realm=/services') + .post('/access_token?realm=/services', function (body : any) { + return body.scope === 'all'; + }) .reply(HttpStatus.OK, { access_token: secondAccessToken })