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

Commit b7e567ba by Mick Hansen

add a test covering a N:M association getter with include, closes #1880

1 parent ffbf373f
Showing with 22 additions and 0 deletions
...@@ -883,4 +883,26 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -883,4 +883,26 @@ describe(Support.getTestDialectTeaser("Include"), function () {
}) })
}) })
}) })
describe('association getter', function () {
it('should support getting an include on a N:M association getter', function () {
var Question = this.sequelize.define('Question', {})
, Answer = this.sequelize.define('Answer', {})
, Questionnaire = this.sequelize.define('Questionnaire', {});
Question.hasMany(Answer);
Answer.hasMany(Question);
Questionnaire.hasMany(Question);
Question.belongsTo(Questionnaire);
return this.sequelize.sync({force: true}).then(function () {
return Questionnaire.create();
}).then(function (questionnaire) {
return questionnaire.getQuestions({
include: Answer
});
});
});
});
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!