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

Commit 5933bc89 by Mick Hansen

add extra case to test

1 parent a814e7fa
Showing with 20 additions and 7 deletions
...@@ -500,12 +500,25 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -500,12 +500,25 @@ describe(Support.getTestDialectTeaser("Include"), function () {
Project.hasMany(Task) Project.hasMany(Task)
Task.belongsTo(Project) Task.belongsTo(Project)
this.sequelize.sync().done(function() { this.sequelize.sync({force: true}).done(function() {
Task.create({title: 'FooBar'}).done(function (err) { Project.create({
Task.findAll({attributes: ['title'], include: [Project]}).done(function(err, tasks) { title: 'BarFoo'
expect(err).not.to.be.ok }).done(function (err, project) {
expect(tasks[0].title).to.equal('FooBar') Task.create({title: 'FooBar'}).done(function (err, task) {
done() task.setProject(project).done(function () {
Task.findAll({
attributes: ['title'],
include: [
{model: Project, attributes: ['title']}
]
}).done(function(err, tasks) {
expect(err).not.to.be.ok
expect(tasks[0].title).to.equal('FooBar')
expect(tasks[0].project.title).to.equal('BarFoo');
done()
})
})
}) })
}) })
}) })
...@@ -518,7 +531,7 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -518,7 +531,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
Group.hasMany(Group, { through: 'groups_outsourcing_companies', as: 'OutsourcingCompanies'}); Group.hasMany(Group, { through: 'groups_outsourcing_companies', as: 'OutsourcingCompanies'});
this.sequelize.sync().done(function (err) { this.sequelize.sync({force: true}).done(function (err) {
Group.bulkCreate([ Group.bulkCreate([
{name: 'SoccerMoms'}, {name: 'SoccerMoms'},
{name: 'Coca Cola'}, {name: 'Coca Cola'},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!