Skip to content

Commit

Permalink
update promise tests to use get() properly
Browse files Browse the repository at this point in the history
  • Loading branch information
partap committed Mar 2, 2015
1 parent 034830b commit f200f6b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/relations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('relations', function () {
var chapters = book.chapters();
chapters.should.eql(ch);

return book.chapters({order: 'name DESC'})
return book.chapters.get({order: 'name DESC'})
.then(function (c) {
should.exist(c);

Expand Down Expand Up @@ -749,7 +749,7 @@ describe('relations', function () {
}).catch(done);

function verify(physician, addressId) {
return physician.patients({include: 'address'})
return physician.patients.get({include: 'address'})
.then(function (ch) {
should.exist(ch);
ch.should.have.lengthOf(1);
Expand Down Expand Up @@ -1318,7 +1318,7 @@ describe('relations', function () {
it('should find record on scope with promises - filtered', function (done) {
Category.findOne()
.then(function (c) {
return c.jobs({ where: { type: 'book' } })
return c.jobs.get({ where: { type: 'book' } })
.then(function(jobs) {
jobs.should.have.length(1);
jobs[0].type.should.equal('book');
Expand Down Expand Up @@ -2213,7 +2213,7 @@ describe('relations', function () {
done();
});
});
}).catch(done);
});
});
});

Expand All @@ -2236,7 +2236,8 @@ describe('relations', function () {
done();
});
});
});
})
.catch(done);
});
});

Expand Down Expand Up @@ -4698,7 +4699,7 @@ describe('relations', function () {
Category.findOne()
.then(function (cat) {
var filter = { where: { name: 'Job 1' } };
return cat.jobs(filter)
return cat.jobs.get(filter)
.then(function (jobs) {
jobs.should.have.length(1);
var p = jobs[0];
Expand Down

0 comments on commit f200f6b

Please sign in to comment.