Comparing version 0.6.6 to 0.6.7
@@ -27,3 +27,3 @@ /* -*- Mode: Javascript; js-indent-level: 2 -*- */ | ||
var id = this._getId(obj, true); | ||
var id = this._getId(obj, !key); | ||
@@ -85,3 +85,3 @@ if (!this._isValidId(id)) { | ||
_updateProp: function(obj, key, val, callback) { | ||
var id = this._getId(obj, true); | ||
var id = this._getId(obj); | ||
if (!this._isValidId(id)) { | ||
@@ -88,0 +88,0 @@ return callback(new Error("Invalid ID")); |
@@ -8,3 +8,3 @@ { | ||
"description": "A thin and familiar layer between node and neo4j's REST api.", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"repository": { | ||
@@ -11,0 +11,0 @@ "url": "https://github.com/brikteknologier/seraph" |
@@ -125,2 +125,20 @@ /* -*- Mode: Javascript; js-indent-level: 2 -*- */ | ||
it('should save a single property of an object, specifying only id', function(done) { | ||
db.save({name: 'bob', age: 46}, function(err, node) { | ||
assert(!err) | ||
assert.equal(node.name, 'bob'); | ||
assert.equal(node.age, 46); | ||
node.name = 'hidden name man'; | ||
db.save(node.id, 'age', 47, function(err, node) { | ||
assert(!err); | ||
db.read(node, function(err, node) { | ||
assert(!err); | ||
assert.equal(node.age, 47); | ||
assert.equal(node.name, 'bob'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
it('should delete a single property of an object', function(done) { | ||
@@ -148,2 +166,24 @@ db.save({name: 'bob', age: 46}, function(err, node) { | ||
it('should delete a single property of an object, specifying only id', function(done) { | ||
db.save({name: 'bob', age: 46}, function(err, node) { | ||
assert(!err) | ||
assert.equal(node.name, 'bob'); | ||
assert.equal(node.age, 46); | ||
node.name = 'hidden name man'; | ||
db.save(node, 'age', 47, function(err, node) { | ||
assert(!err); | ||
db.delete(node.id, 'age', function(err) { | ||
assert(!err); | ||
db.read(node, function(err, node) { | ||
console.log(err) | ||
assert(!err); | ||
assert(node.age == null); | ||
assert(node.name == 'bob'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
it('should read a single property of an object', function(done) { | ||
@@ -150,0 +190,0 @@ db.save({name: 'bob', age: 47}, function(err, node) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148841
3283