Added Storage#readWallet and used this from WalletFactory

This commit is contained in:
Ivan Socolsky 2014-09-23 10:16:26 -03:00
commit 0f37ea1929
4 changed files with 105 additions and 63 deletions

View file

@ -246,7 +246,7 @@ describe('WalletFactory model', function() {
describe('#read', function() {
it('should fail to read unexisting wallet', function(done) {
wf.storage.getMany = sinon.stub().yields({});
wf.storage.readWallet = sinon.stub().yields({});
wf.read('id', [], function(err, w) {
should.not.exist(w);
@ -258,7 +258,7 @@ describe('WalletFactory model', function() {
});
});
it('should fail to read broken wallet', function(done) {
wf.storage.getMany = sinon.stub().yields({
wf.storage.readWallet = sinon.stub().yields({
'opts': 1
});
wf.read('id', [], function(err, w) {
@ -272,7 +272,7 @@ describe('WalletFactory model', function() {
});
it('should read existing wallet', function(done) {
var wf = new WalletFactory(config, '0.0.1');
wf.storage.getMany = sinon.stub().yields({
wf.storage.readWallet = sinon.stub().yields({
'opts': 1
});
wf.fromObj = sinon.stub().returns('ok');