Permalink
Browse files

correct promises chain

  • Loading branch information...
1 parent beabcdb commit 532d798ab38a4d6912c8def99f8e0d283e937439 @andriykuba committed Jan 14, 2014
Showing with 12 additions and 15 deletions.
  1. +12 −15 test/functional.js
View
@@ -337,28 +337,25 @@ describe('Debitoor', function(){
tools
.modifyCustomers()
.then(function(){
-
- importContacts('update')
- .then(function(res){
- checkImportedContactsEquals(res, done);
- })
- .fail(done);
-
+ return importContacts('update')
+ })
+ .then(function(res){
+ checkImportedContactsEquals(res, done);
})
.fail(done);
});
it('only contacts that is not present as customers', function(done){
+
+ var modifyed = null;
tools
.modifyCustomers()
- .then(function(modifyed){
-
- importContacts('ignore')
- .then(function (res){
- checkImportedContactsDifferent(modifyed, res, done);
- })
- .fail(done);
-
+ .then(function(res){
+ modifyed = res;
+ return importContacts('ignore')
+ })
+ .then(function (res){
+ checkImportedContactsDifferent(modifyed, res, done);
})
.fail(done);
});

0 comments on commit 532d798

Please sign in to comment.