Skip to content

Commit

Permalink
Small fix on test.
Browse files Browse the repository at this point in the history
  • Loading branch information
gfzabarino committed Nov 7, 2014
1 parent 7838f14 commit cbdd355
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/models/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,21 @@ describe('<Unit Test>', function() {
});

afterEach(function(done) {
var entities = [];
if (entity) {
entities.push(entity);
entity.destroy().success(done).error(done);
entity = undefined;
} else {
done();
}
});

after(function(done) {
if (challenge) {
entities.push(challenge);
challenge.destroy().success(done).error(done);
challenge = undefined;
} else {
done();
}
async.forEach(entities, function (entity, callback) {
entity.destroy().success(callback)
.error(callback);
}, done);
});
});
});

0 comments on commit cbdd355

Please sign in to comment.