From 4cea5a4a278e97c7990f287d328a3f5ab3a70139 Mon Sep 17 00:00:00 2001 From: Vincenzo Chianese Date: Thu, 26 Oct 2017 09:54:22 +0200 Subject: [PATCH] Fix credential creations test --- test/cli/credentials/create.test.js | 52 ++++++++++++++--------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/test/cli/credentials/create.test.js b/test/cli/credentials/create.test.js index 60e41be4a..e2ba74f97 100644 --- a/test/cli/credentials/create.test.js +++ b/test/cli/credentials/create.test.js @@ -22,9 +22,9 @@ describe('eg credentials create', () => { firstname: 'La', lastname: 'Deeda' }) - .then(createdUser => { - user = createdUser; - }); + .then(createdUser => { + user = createdUser; + }); }); afterEach(() => { @@ -55,13 +55,13 @@ describe('eg credentials create', () => { assert.equal(text, 'Created ' + loggedCred.keyId); return adminHelper.admin.credentials.info(loggedCred.keyId, 'key-auth') - .then(cred => { - assert.ok(cred.keyId); - assert.ok(cred.keySecret); - assert.ok(cred.isActive); - assert.equal(cred.consumerId, user.username); - done(); - }).catch(done); + .then(cred => { + assert.ok(cred.keyId); + assert.ok(cred.keySecret); + assert.ok(cred.isActive); + assert.equal(cred.consumerId, user.id); + done(); + }).catch(done); }); }); @@ -95,13 +95,13 @@ describe('eg credentials create', () => { const loggedCred = JSON.parse(output); assert.equal(text, 'Created ' + loggedCred.keyId); return adminHelper.admin.credentials.info(loggedCred.keyId, 'key-auth') - .then(cred => { - assert.ok(cred.keyId); - assert.ok(cred.keySecret); - assert.ok(cred.isActive); - assert.equal(cred.consumerId, user.username); - done(); - }).catch(done); + .then(cred => { + assert.ok(cred.keyId); + assert.ok(cred.keySecret); + assert.ok(cred.isActive); + assert.equal(cred.consumerId, user.id); + done(); + }).catch(done); }); }); @@ -124,15 +124,15 @@ describe('eg credentials create', () => { generator.once('end', () => { const loggedCred = output.split(':')[0]; return adminHelper.admin.credentials.info(loggedCred, 'key-auth') - .then(cred => { - assert.ok(cred.keyId); - assert.ok(cred.keySecret); - assert.ok(cred.isActive); - assert.equal(cred.consumerId, user.username); - assert.equal(output, cred.keyId + ':' + cred.keySecret); - - done(); - }).catch(done); + .then(cred => { + assert.ok(cred.keyId); + assert.ok(cred.keySecret); + assert.ok(cred.isActive); + assert.equal(cred.consumerId, user.id); + assert.equal(output, cred.keyId + ':' + cred.keySecret); + + done(); + }).catch(done); }); });