ensure app is booted before integration tests

This commit is contained in:
Ryan Graham 2015-12-31 16:52:31 -08:00 committed by Miroslav Bajtoš
parent 0ad150cb6e
commit c317204c74
1 changed files with 6 additions and 1 deletions

View File

@ -18,13 +18,18 @@ _beforeEach.withApp = function(app) {
app.models.User.settings.saltWorkFactor = 4; app.models.User.settings.saltWorkFactor = 4;
} }
beforeEach(function() { beforeEach(function(done) {
this.app = app; this.app = app;
var _request = this.request = request(app); var _request = this.request = request(app);
this.post = _request.post; this.post = _request.post;
this.get = _request.get; this.get = _request.get;
this.put = _request.put; this.put = _request.put;
this.del = _request.del; this.del = _request.del;
if (app.booting) {
return app.once('booted', done);
}
done();
}); });
}; };