Fix id comparision in tests so that they work with mongodb object id

This commit is contained in:
Raymond Feng 2015-09-08 09:53:02 -07:00
parent 207edd5eec
commit a6519bb2ca
1 changed files with 9 additions and 9 deletions

View File

@ -3135,9 +3135,9 @@ describe('relations', function () {
should.not.exist(e); should.not.exist(e);
should.exist(boss); should.exist(boss);
boss.should.be.an.instanceOf(Boss); boss.should.be.an.instanceOf(Boss);
companyBoard.boss().id.should.equal(boss.id); companyBoard.boss().id.should.eql(boss.id);
boss.boardMembersNumber.should.equal(companyBoard.membersNumber); boss.boardMembersNumber.should.eql(companyBoard.membersNumber);
boss.companyId.should.equal(companyBoard.companyId); boss.companyId.should.eql(companyBoard.companyId);
done(); done();
}); });
}); });
@ -3203,7 +3203,7 @@ describe('relations', function () {
should.exist(employee); should.exist(employee);
employees.length.should.equal(2); employees.length.should.equal(2);
employee.should.be.an.instanceOf(Employee); employee.should.be.an.instanceOf(Employee);
employee.companyId.should.be.equal(boss.companyId); employee.companyId.should.be.eql(boss.companyId);
return employees; return employees;
}) })
}); });
@ -3260,7 +3260,7 @@ describe('relations', function () {
}) })
.then(function (boss) { .then(function (boss) {
should.exists(boss); should.exists(boss);
boss.id.should.equal(bossId); boss.id.should.eql(bossId);
}); });
}); });
}); });
@ -3310,8 +3310,8 @@ describe('relations', function () {
should.not.exist(e); should.not.exist(e);
should.exist(at); should.exist(at);
at.should.be.an.instanceOf(ArticleTag); at.should.be.an.instanceOf(ArticleTag);
at.tagNameId.should.equal(tag.id); at.tagNameId.should.eql(tag.id);
at.articleId.should.equal(article.id); at.articleId.should.eql(article.id);
done(); done();
}); });
}); });
@ -3374,8 +3374,8 @@ describe('relations', function () {
.then(function (at) { .then(function (at) {
should.exist(at); should.exist(at);
at.should.be.an.instanceOf(ArticleTag); at.should.be.an.instanceOf(ArticleTag);
at.tagNameId.should.equal(tag.id); at.tagNameId.should.eql(tag.id);
at.articleId.should.equal(article.id); at.articleId.should.eql(article.id);
done(); done();
}); });
}) })