Skip to content

Commit

Permalink
hasOne() associations need to work when the FK value is 0. Pre-existi…
Browse files Browse the repository at this point in the history
…ng databases may've used zero as a valid entity identifier.
stueynz committed Dec 4, 2015
1 parent c506168 commit df04024
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/integration/association-hasone-zeroid.js
Original file line number Diff line number Diff line change
@@ -110,12 +110,12 @@ describe("hasOne", function() {
pets[0].should.not.have.property("owner");

// But we should be able to see if its there
pets[0].hasOwner(function(result) {
pets[0].hasOwner(function(err, result) {
should.equal(result, true);
});

// ...and then get it
pets[0].getOwner(function(result) {
pets[0].getOwner(function(err, result) {
result.firstName.should.equal("Stuey");
});

@@ -135,12 +135,12 @@ describe("hasOne", function() {
pets[0].should.not.have.property("owner");

// But we should be able to see if its there
pets[0].hasOwner(function(result) {
pets[0].hasOwner(function(err, result) {
should.equal(result, true);
});

// ...and then get it
pets[0].getOwner(function(result) {
pets[0].getOwner(function(err, result) {
result.firstName.should.equal("John");
});

0 comments on commit df04024

Please sign in to comment.