Fix the test case so that it works with other DBs

This commit is contained in:
Raymond Feng 2014-08-08 09:39:36 -07:00
parent 366ff3bf62
commit 950be998bc
1 changed files with 3 additions and 3 deletions

View File

@ -284,17 +284,17 @@ describe('relations', function () {
Address.create({name: 'z'}, function (err, address) {
patient.address(address);
patient.save(function() {
verify(physician);
verify(physician, address.id);
});
});
});
});
function verify(physician) {
function verify(physician, addressId) {
physician.patients({include: 'address'}, function (err, ch) {
should.not.exist(err);
should.exist(ch);
ch.should.have.lengthOf(1);
ch[0].addressId.should.equal(1);
ch[0].addressId.should.eql(addressId);
var address = ch[0].address();
should.exist(address);
address.should.be.an.instanceof(Address);