Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mickhansen committed Jan 10, 2015
1 parent 0258fff commit 87de0d9
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions test/include/findAll.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2011,10 +2011,7 @@ describe(Support.getTestDialectTeaser('Include'), function() {
var UserPerson = this.sequelize.define("UserPerson", {
PersonId: {
type : Sequelize.INTEGER,
primaryKey : true,
references : Person,
referencesKey : 'id',
field : 'id'
primaryKey : true
},

rank: {
Expand All @@ -2025,10 +2022,7 @@ describe(Support.getTestDialectTeaser('Include'), function() {
var User = this.sequelize.define("User", {
UserPersonId: {
type : Sequelize.INTEGER,
primaryKey : true,
references : UserPerson,
referencesKey : 'id',
field : 'id'
primaryKey : true
},

login: {
Expand All @@ -2038,22 +2032,33 @@ describe(Support.getTestDialectTeaser('Include'), function() {
}
});


Person.hasOne(UserPerson);
UserPerson.belongsTo(Person, {
foreignKey: {
allowNull: false
}
allowNull: false
},
onDelete: 'CASCADE'
});

UserPerson.hasOne(User);
Person.hasOne(UserPerson, {
foreignKey: {
allowNull: false
},
onDelete: 'CASCADE'
});

User.belongsTo(UserPerson, {
foreignKey: {
name: 'UserPersonId',
allowNull: false
}
allowNull: false
},
onDelete: 'CASCADE'
});
UserPerson.hasOne(User, {
foreignKey: {
name: 'UserPersonId',
allowNull: false
},
onDelete: 'CASCADE'
});


return this.sequelize.sync({force: true}).then(function () {
return Person.findAll({
Expand Down

0 comments on commit 87de0d9

Please sign in to comment.