Skip to content

Commit

Permalink
test: scope with operators work for findAll (#8926)
Browse files Browse the repository at this point in the history
  • Loading branch information
sushantdhiman committed Jan 21, 2018
1 parent 1d0553b commit 8b8d65e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/integration/model/scope.test.js
Expand Up @@ -33,6 +33,13 @@ describe(Support.getTestDialectTeaser('Model'), () => {
{ access_level: { [Sequelize.Op.eq]: 10 } }
]
}
},
lessThanFour: {
where: {
[Sequelize.Op.and]: [
{ access_level: { [Sequelize.Op.lt]: 4 } }
]
}
}
}
});
Expand Down Expand Up @@ -61,6 +68,12 @@ describe(Support.getTestDialectTeaser('Model'), () => {
return this.ScopeMe.scope('highAccess').findOne()
.then(record => {
expect(record.username).to.equal('tobi');
return this.ScopeMe.scope('lessThanFour').findAll();
})
.then(records => {
expect(records).to.have.length(2);
expect(records[0].get('access_level')).to.equal(3);
expect(records[1].get('access_level')).to.equal(3);
});
});
});
Expand Down

0 comments on commit 8b8d65e

Please sign in to comment.