Merge pull request #62 from maraoz/fix/bind-usage

fix bind usage in some tests
This commit is contained in:
Ryan X. Charles 2014-04-17 10:30:23 -03:00
commit aaaed8e7ee

View file

@ -56,7 +56,7 @@ describe('PublicKeyRing model', function() {
w2.registeredCopayers().should.equal(0); w2.registeredCopayers().should.equal(0);
w2.isComplete().should.equal(false); w2.isComplete().should.equal(false);
w2.getAddress.bind(false).should.throw(); (function() {w2.getAddress(0, false);}).should.throw();
}); });
it('should add and check when adding shared pub keys', function () { it('should add and check when adding shared pub keys', function () {
@ -65,9 +65,10 @@ describe('PublicKeyRing model', function() {
var copayers = k.copayers; var copayers = k.copayers;
w.isComplete().should.equal(true); w.isComplete().should.equal(true);
w.addCopayer.bind().should.throw(); w.addCopayer.should.throw();
for(var i =0; i<5; i++) for(var i =0; i<5; i++) {
w.addCopayer.bind(copayers[i]).should.throw(); (function() {w.addCopayer(copayers[i])}).should.throw();
}
}); });
it('show be able to tostore and read', function () { it('show be able to tostore and read', function () {
@ -85,9 +86,10 @@ describe('PublicKeyRing model', function() {
var w2 = PublicKeyRing.fromObj(data); var w2 = PublicKeyRing.fromObj(data);
w2.walletId.should.equal(w.walletId); w2.walletId.should.equal(w.walletId);
w2.isComplete().should.equal(true); w2.isComplete().should.equal(true);
w2.addCopayer.bind().should.throw(); w2.addCopayer.should.throw();
for(var i =0; i<5; i++) for(var i =0; i<5; i++) {
w2.addCopayer.bind(copayers[i]).should.throw(); (function() {w.addCopayer(copayers[i])}).should.throw();
}
w2.changeAddressIndex.should.equal(3); w2.changeAddressIndex.should.equal(3);
w2.addressIndex.should.equal(5); w2.addressIndex.should.equal(5);