Automigrate before relation tests

This commit is contained in:
Anatoliy Chakkaev 2013-03-31 15:24:03 +04:00
parent e8077faa1c
commit 349931780a
1 changed files with 10 additions and 8 deletions

View File

@ -117,14 +117,16 @@ describe('relations', function() {
it('can be used to query data', function(done) {
List.hasMany('todos', {model: Item});
List.create(function(e, list) {
should.not.exist(e);
should.exist(list);
list.todos.create(function(err, todo) {
todo.list(function(e, l) {
should.not.exist(e);
should.exist(l);
done();
db.automigrate(function() {
List.create(function(e, list) {
should.not.exist(e);
should.exist(list);
list.todos.create(function(err, todo) {
todo.list(function(e, l) {
should.not.exist(e);
should.exist(l);
done();
});
});
});
});