update models tests to new API

This commit is contained in:
Matias Alejo Garcia 2014-10-10 12:02:46 -03:00
commit b5f05118c7
4 changed files with 22 additions and 21 deletions

View file

@ -419,20 +419,15 @@ describe('Wallet model', function() {
it('decodeSecret check', function() {
(function() {
Wallet.decodeSecret('4fp61K187CsYmjoRQC5iAdC5eGmbCRsAAXfwEwetSQgHvZs27eWKaLaNHRoKM');
}).should.not.
throw();
var s = Wallet.decodeSecret('4fp61K187CsYmjoRQC5iAdC5eGmbCRsAAXfwEwetSQgHvZs27eWKaLaNHRoKM');
should.exist(s);
(function() {
Wallet.decodeSecret('4fp61K187CsYmjoRQC5iAdC5eGmbCRsAAXfwEwetSQgHvZs27eWKaLaNHRoK');
}).should.
throw();
s= Wallet.decodeSecret('4fp61K187CsYmjoRQC5iAdC5eGmbCRsAAXfwEwetSQgHvZs27eWKaLaNHRoK');
s.should.equal(false);
(function() {
Wallet.decodeSecret('12345');
}).should.
throw();
s= Wallet.decodeSecret('123456');
s.should.equal(false);
});

View file

@ -42,6 +42,7 @@ describe('Identity model', function() {
wallet = sinon.stub();
wallet.store = sinon.stub().yields(null);
wallet.netStart = sinon.stub();
wallet.getId = sinon.stub().returns('wid:123');
Identity._newWallet = sinon.stub().returns(wallet);
@ -129,7 +130,7 @@ describe('Identity model', function() {
storage.getFirst = sinon.stub().yields('wallet1234');
profile.listWallets = sinon.stub().returns([{id:'walletid'}]);
Identity._openProfile = sinon.stub().callsArgWith(3, null, profile);
Identity._walletRead = sinon.stub().callsArgWith(5, null, wallet);
Identity._walletRead = sinon.stub().callsArgWith(2, null, wallet);
});
it('should call ._openProfile', function(done) {
@ -234,7 +235,7 @@ describe('Identity model', function() {
var wallet = sinon.stub();
wallet.store = sinon.stub().yields(null);
Identity._walletRead = sinon.stub().callsArgWith(5, null, wallet);
Identity._walletRead = sinon.stub().callsArgWith(2, null, wallet);
});
it('should return wallet and call .store, .setLastOpenedTs & .migrateWallet', function(done) {