不要怂,就是干,撸起袖子干!

Commit cefcda37 by Joe Lutz

Fix test 'should support renaming of sequelize method fields'

1 parent e7c0351e
Showing with 6 additions and 6 deletions
......@@ -258,22 +258,22 @@ describe(Support.getTestDialectTeaser("Model"), function () {
});
it('should support renaming of sequelize method fields', function () {
var User = this.sequelize.define('user', {
var Test = this.sequelize.define('test', {
someProperty: Sequelize.VIRTUAL // Since we specify the AS part as a part of the literal string, not with sequelize syntax, we have to tell sequelize about the field
});
return this.sequelize.sync({ force: true }).then(function () {
return User.create({});
return Test.create({});
}).then(function () {
return User.findAll({
return Test.findAll({
attributes: [
Sequelize.literal('EXISTS(SELECT 1) AS "someProperty"'),
[Sequelize.literal('EXISTS(SELECT 1)'), 'someProperty2']
]
});
}).then(function (users) {
expect(users[0].get('someProperty')).to.be.ok;
expect(users[0].get('someProperty2')).to.be.ok;
}).then(function (tests) {
expect(tests[0].get('someProperty')).to.be.ok;
expect(tests[0].get('someProperty2')).to.be.ok;
});
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!