diff options
Got encrypting working, not yet decrypting
Diffstat (limited to 'test/integration/lib')
-rw-r--r-- | test/integration/lib/encryptor-test.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/integration/lib/encryptor-test.js b/test/integration/lib/encryptor-test.js index 21d6ee6f7..f5cdea835 100644 --- a/test/integration/lib/encryptor-test.js +++ b/test/integration/lib/encryptor-test.js @@ -1,14 +1,25 @@ var encryptor = require('../../../app/scripts/lib/encryptor') QUnit.test('encryptor', function(assert) { + var done = assert.async(); var password, data, encrypted password = 'a sample passw0rd' data = { foo: 'data to encrypt' } encryptor.encrypt(password, data) - .then(function(result) { - assert.equal(typeof result, 'string', 'returns a string') + .then(function(encryptedStr) { + + assert.equal(typeof encryptedStr, 'string', 'returns a string') + + // Now try decrypting!jk + // + return encryptor.decrypt(password, encryptedStr) + + }) + .then(function (decryptedObj) { + assert.equal(decryptedObj, data, 'decrypted what was encrypted') + done() }) .catch(function(reason) { assert.ifError(reason, 'threw an error') |