From 2bc19453094a43736b6f84cc52deb90c0b6bfd5d Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Sat, 27 Sep 2014 16:43:10 -0300 Subject: [PATCH] refactor password param --- js/models/{Storage.js => WalletStorage.js} | 0 test/Storage.js | 6 ++++-- test/mocks/FakeLocalStorage.js | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) rename js/models/{Storage.js => WalletStorage.js} (100%) diff --git a/js/models/Storage.js b/js/models/WalletStorage.js similarity index 100% rename from js/models/Storage.js rename to js/models/WalletStorage.js diff --git a/test/Storage.js b/test/Storage.js index e48de991d..781bb591c 100644 --- a/test/Storage.js +++ b/test/Storage.js @@ -22,8 +22,10 @@ describe('Storage model', function() { it('should fail when encrypting without a password', function() { var s2 = new Storage(requireMock('FakeLocalStorage').storageParams); (function() { - s2._write(fakeWallet + timeStamp, 1, function() {}); - }).should.throw('NOPASSPHRASE'); + var params = _.clone(require('./mocks/FakeLocalStorage').storageParams); + params.password = undefined; + new Storage(params); + }).should.throw('Illegal Argument'); }); it('should be able to encrypt and decrypt', function(done) { s._write(fakeWallet + timeStamp, 'value', function() { diff --git a/test/mocks/FakeLocalStorage.js b/test/mocks/FakeLocalStorage.js index c2ae7ce14..47fdb8c1c 100644 --- a/test/mocks/FakeLocalStorage.js +++ b/test/mocks/FakeLocalStorage.js @@ -28,6 +28,7 @@ FakeLocalStorage.prototype.clear = function() { module.exports = FakeLocalStorage; module.exports.storageParams = { + password: '123', storage: new FakeLocalStorage(), sessionStorage: new FakeLocalStorage(), };