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

Commit 72f14fc5 by Bulkan Evcimen

test for a possible bug with update ARRAY(JSON)

1 parent a3e737cd
Showing with 23 additions and 1 deletions
......@@ -20,7 +20,11 @@ if (dialect.match(/^postgres/)) {
settings: DataTypes.HSTORE,
document: { type: DataTypes.HSTORE, defaultValue: { default: "'value'" } },
phones: DataTypes.ARRAY(DataTypes.HSTORE),
emergency_contact: DataTypes.JSON
emergency_contact: DataTypes.JSON,
friends: {
type: DataTypes.ARRAY(DataTypes.JSON),
defaultValue: []
}
});
this.User.sync({ force: true }).success(function() {
done();
......@@ -39,6 +43,24 @@ if (dialect.match(/^postgres/)) {
});
});
it.only('should be able update a field with type ARRAY(JSON)', function(){
var self = this;
return this.User.create({
username: 'bob', email: ['myemail@email.com']
})
.then(function(userInstance){
console.log(userInstance);
expect(userInstance.friends).to.have.length(0);
return userInstance.updateAttributes({
friends: [{
name: 'John Smythe'
}]
});
});
});
it('should be able to find a record while searching in an array', function(done) {
var self = this;
this.User.bulkCreate([
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!