Automigrate before relation tests
This commit is contained in:
parent
e8077faa1c
commit
349931780a
|
@ -117,14 +117,16 @@ describe('relations', function() {
|
||||||
|
|
||||||
it('can be used to query data', function(done) {
|
it('can be used to query data', function(done) {
|
||||||
List.hasMany('todos', {model: Item});
|
List.hasMany('todos', {model: Item});
|
||||||
List.create(function(e, list) {
|
db.automigrate(function() {
|
||||||
should.not.exist(e);
|
List.create(function(e, list) {
|
||||||
should.exist(list);
|
should.not.exist(e);
|
||||||
list.todos.create(function(err, todo) {
|
should.exist(list);
|
||||||
todo.list(function(e, l) {
|
list.todos.create(function(err, todo) {
|
||||||
should.not.exist(e);
|
todo.list(function(e, l) {
|
||||||
should.exist(l);
|
should.not.exist(e);
|
||||||
done();
|
should.exist(l);
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue