Migration-friendly tests

This commit is contained in:
Anatoliy Chakkaev 2013-03-27 04:50:34 +04:00
parent 2749a1f7e0
commit ffdfac30e1
2 changed files with 9 additions and 5 deletions

View File

@ -2,7 +2,7 @@ var db, User, should = require('should');
describe('basic-querying', function() {
before(function() {
before(function(done) {
db = getSchema();
User = db.define('User', {
@ -12,6 +12,8 @@ describe('basic-querying', function() {
order: {type: Number, index: true}
});
db.automigrate(done);
});
@ -193,7 +195,7 @@ describe('basic-querying', function() {
User.exists(u.id, function(err, exists) {
should.not.exist(err);
should.exist(exists);
exists.should.be.true;
exists.should.be.ok;
done();
});
});
@ -203,7 +205,7 @@ describe('basic-querying', function() {
User.destroyAll(function() {
User.exists(42, function(err, exists) {
should.not.exist(err);
exists.should.be.false;
exists.should.not.be.ok;
done();
});
});

View File

@ -8,15 +8,17 @@ var j = require('../'),
describe('hooks', function() {
before(function() {
before(function(done) {
db = getSchema();
User = db.define('User', {
email: String,
email: {type: String, index: true},
name: String,
password: String,
state: String
});
db.automigrate(done);
});
describe('initialize', function() {