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

Commit 09437fbe by Matthew Ohlman

Add test for bugfix

1 parent d30e1dc2
Showing with 33 additions and 2 deletions
......@@ -63,7 +63,11 @@ describe(Support.getTestDialectTeaser("Model"), function () {
text: {
type: DataTypes.STRING,
field: 'comment_text'
}
},
notes: {
type: DataTypes.STRING,
field: 'notes'
}
}, {
tableName: 'comments',
timestamps: false
......@@ -120,7 +124,10 @@ describe(Support.getTestDialectTeaser("Model"), function () {
},
comment_text: {
type: DataTypes.STRING
}
},
notes: {
type: DataTypes.STRING
}
})
]);
});
......@@ -247,6 +254,30 @@ describe(Support.getTestDialectTeaser("Model"), function () {
});
});
});
it('field names that are the same as property names should create, update, and read correctly', function () {
var self = this;
return this.Comment.create({
notes: 'Foobar'
}).then(function () {
return self.Comment.find({
limit: 1
});
}).then(function (comment) {
expect(comment.get('notes')).to.equal('Foobar');
return comment.updateAttributes({
notes: 'Barfoo'
});
}).then(function () {
return self.Comment.find({
limit: 1
});
}).then(function (comment) {
expect(comment.get('notes')).to.equal('Barfoo');
});
});
});
describe('types', function () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!