Mongodb tolerance
This commit is contained in:
parent
928a366860
commit
2d6cc9aaee
|
@ -146,7 +146,7 @@ describe('basic-querying', function() {
|
|||
User.findOne(function(e, u) {
|
||||
should.not.exist(e);
|
||||
should.exist(u);
|
||||
u.id.should.equal(users[0].id);
|
||||
u.id.toString().should.equal(users[0].id.toString());
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@ -185,6 +185,16 @@ describe('basic-querying', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it.only('should work even when find by id', function(done) {
|
||||
User.findOne(function(e, u) {
|
||||
User.findOne({where: {id: u.id}}, function(err, user) {
|
||||
should.not.exist(err);
|
||||
should.exist(user);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('exists', function() {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
require('./basic-querying.test.js');
|
||||
require('./hooks.test.js');
|
||||
require('./relations.test.js');
|
||||
|
|
|
@ -42,7 +42,7 @@ describe('hooks', function() {
|
|||
}
|
||||
};
|
||||
User.create({name: 'Nickolay'}, function(err, u) {
|
||||
u.id.should.be.a('number');
|
||||
u.id.should.be.ok;
|
||||
u.name.should.equal('Nickolay Rozental');
|
||||
done();
|
||||
});
|
||||
|
|
|
@ -43,7 +43,7 @@ describe('relations', function() {
|
|||
(new Author).readers.should.be.an.instanceOf(Function);
|
||||
Object.keys((new Reader).toObject()).should.include('authorId');
|
||||
|
||||
db.automigrate(done);
|
||||
db.autoupdate(done);
|
||||
});
|
||||
|
||||
it('should build record on scope', function(done) {
|
||||
|
@ -115,7 +115,20 @@ describe('relations', function() {
|
|||
// (new Fear).mind.build().should.be.an.instanceOf(Mind);
|
||||
});
|
||||
|
||||
it('can be declared in short form');
|
||||
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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('hasAndBelongsToMany', function() {
|
||||
|
|
Loading…
Reference in New Issue