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

Commit 09437fbe by Matthew Ohlman

Add test for bugfix

1 parent d30e1dc2
Showing with 31 additions and 0 deletions
...@@ -63,6 +63,10 @@ describe(Support.getTestDialectTeaser("Model"), function () { ...@@ -63,6 +63,10 @@ describe(Support.getTestDialectTeaser("Model"), function () {
text: { text: {
type: DataTypes.STRING, type: DataTypes.STRING,
field: 'comment_text' field: 'comment_text'
},
notes: {
type: DataTypes.STRING,
field: 'notes'
} }
}, { }, {
tableName: 'comments', tableName: 'comments',
...@@ -120,6 +124,9 @@ describe(Support.getTestDialectTeaser("Model"), function () { ...@@ -120,6 +124,9 @@ describe(Support.getTestDialectTeaser("Model"), function () {
}, },
comment_text: { comment_text: {
type: DataTypes.STRING type: DataTypes.STRING
},
notes: {
type: DataTypes.STRING
} }
}) })
]); ]);
...@@ -247,6 +254,30 @@ describe(Support.getTestDialectTeaser("Model"), function () { ...@@ -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 () { describe('types', function () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!