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

Commit 59e737c9 by Mick Hansen

fix skipped tests

1 parent 99e915b8
Showing with 28 additions and 29 deletions
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/* jshint -W110 */ /* jshint -W110 */
var Support = require(__dirname + '/../support') var Support = require(__dirname + '/../support')
, DataTypes = require(__dirname + '/../../../lib/data-types') , DataTypes = require(__dirname + '/../../../lib/data-types')
, Model = require(__dirname + '/../../../lib/model')
, expectsql = Support.expectsql , expectsql = Support.expectsql
, current = Support.sequelize , current = Support.sequelize
, sql = current.dialect.QueryGenerator; , sql = current.dialect.QueryGenerator;
...@@ -25,7 +26,7 @@ describe(Support.getTestDialectTeaser('SQL'), function() { ...@@ -25,7 +26,7 @@ describe(Support.getTestDialectTeaser('SQL'), function() {
}); });
}); });
it.skip('include (left outer join)', function () { it('include (left outer join)', function () {
var User = Support.sequelize.define('User', { var User = Support.sequelize.define('User', {
name: DataTypes.STRING, name: DataTypes.STRING,
age: DataTypes.INTEGER age: DataTypes.INTEGER
...@@ -40,21 +41,20 @@ describe(Support.getTestDialectTeaser('SQL'), function() { ...@@ -40,21 +41,20 @@ describe(Support.getTestDialectTeaser('SQL'), function() {
freezeTableName: true freezeTableName: true
}); });
User.Posts = User.hasMany(Post, {foreignKey: 'user_id'});
expectsql(sql.selectQuery('User', { expectsql(sql.selectQuery('User', {
attributes: ['name', 'age'], attributes: ['name', 'age'],
include: [ { include: Model.$validateIncludedElements({
model: Post, include: [{
attributes: ['title'], attributes: ['title'],
association: { association: User.Posts
source: User, }],
target: Post, model: User
identifier: 'user_id' }).include,
}, model: User
as: 'Post' }, User), {
} ], default: 'SELECT [User].[name], [User].[age], [Posts].[id] AS [Posts.id], [Posts].[title] AS [Posts.title] FROM [User] AS [User] LEFT OUTER JOIN [Post] AS [Posts] ON [User].[id] = [Posts].[user_id];'
tableAs: 'User'
}), {
default: 'SELECT [User].[name], [User].[age], [Post].[title] AS [Post.title] FROM [User] AS [User] LEFT OUTER JOIN [Post] AS [Post] ON [User].[id] = [Post].[user_id];'
}); });
}); });
}); });
...@@ -83,7 +83,7 @@ describe(Support.getTestDialectTeaser('SQL'), function() { ...@@ -83,7 +83,7 @@ describe(Support.getTestDialectTeaser('SQL'), function() {
}); });
}); });
it.skip('include (left outer join)', function () { it('include (left outer join)', function () {
var User = Support.sequelize.define('User', { var User = Support.sequelize.define('User', {
name: DataTypes.STRING, name: DataTypes.STRING,
age: DataTypes.INTEGER age: DataTypes.INTEGER
...@@ -98,22 +98,21 @@ describe(Support.getTestDialectTeaser('SQL'), function() { ...@@ -98,22 +98,21 @@ describe(Support.getTestDialectTeaser('SQL'), function() {
freezeTableName: true freezeTableName: true
}); });
User.Posts = User.hasMany(Post, {foreignKey: 'user_id'});
expectsql(sql.selectQuery('User', { expectsql(sql.selectQuery('User', {
attributes: ['name', 'age'], attributes: ['name', 'age'],
include: [ { include: Model.$validateIncludedElements({
model: Post, include: [{
attributes: ['title'], attributes: ['title'],
association: { association: User.Posts
source: Post, }],
target: User, model: User
identifier: 'user_id' }).include,
}, model: User
as: 'Post' }, User), {
} ], default: 'SELECT [User].[name], [User].[age], [Posts].[id] AS [Posts.id], [Posts].[title] AS [Posts.title] FROM [User] AS [User] LEFT OUTER JOIN [Post] AS [Posts] ON [User].[id] = [Posts].[user_id];',
tableAs: 'User' postgres: 'SELECT User.name, User.age, Posts.id AS "Posts.id", Posts.title AS "Posts.title" FROM User AS User LEFT OUTER JOIN Post AS Posts ON User.id = Posts.user_id;'
}), {
default: 'SELECT [User].[name], [User].[age], [Post].[title] AS [Post.title] FROM [User] AS [User] LEFT OUTER JOIN [Post] AS [Post] ON [User].[id] = [Post].[user_id];',
postgres: 'SELECT User.name, User.age, Post.title AS "Post.title" FROM User AS User LEFT OUTER JOIN Post AS Post ON User.id = Post.user_id;'
}); });
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!