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

Commit 50a3b928 by Mick Hansen

test for instance update on jsonb values

1 parent b1df8684
Showing with 34 additions and 0 deletions
...@@ -51,6 +51,40 @@ describe(Support.getTestDialectTeaser('Model'), function() { ...@@ -51,6 +51,40 @@ describe(Support.getTestDialectTeaser('Model'), function() {
}); });
}); });
it('should update an instance with JSONB data', function () {
return this.Event.create({
data: {
name: {
first: 'Homer',
last: 'Simpson'
},
employment: 'Nuclear Safety Inspector'
}
}).bind(this).then(function (event) {
return event.update({
data: {
name: {
first: 'Homer',
last: 'Simpson'
},
employment: null
}
});
}).then(function () {
return this.Event.findAll().then(function (events) {
var event = events[0];
expect(event.get('data')).to.eql({
name: {
first: 'Homer',
last: 'Simpson'
},
employment: null
});
});
});
});
it('should be possible to query a nested value', function () { it('should be possible to query a nested value', function () {
return Promise.join( return Promise.join(
this.Event.create({ this.Event.create({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!