add sinon for fromObj

This commit is contained in:
Matias Alejo Garcia 2014-09-29 12:11:10 -03:00
commit 1dd906afcd
4 changed files with 356 additions and 43 deletions

View file

@ -228,8 +228,8 @@ describe('Identity model', function() {
describe.only('#importWallet', function() {
it('should create wallet from encrypted object', function() {
iden.storage.setPassphrase = sinon.spy();
iden.storage.decrypt = sinon.stub().withArgs('base64').returns('walletObj');
iden.fromObj = sinon.stub().withArgs('walletObj').returns('ok');
iden.storage.decrypt = sinon.stub().withArgs('base64').returns({networkName:'testnet'});
Identity._walletFromObj = sinon.stub().withArgs('walletObj').returns('ok');
var w = iden.importWallet("encrypted object", "123");