Browse files

[package, saniize, relationship] fixed npm test, sanitize _id for Fac…

…tory.get, fixed test error
  • Loading branch information...
1 parent d8cd9f6 commit 5e2d22b68a87278f148084fc49eea3c19bd3b356 @indutny indutny committed Sep 27, 2011
Showing with 5 additions and 2 deletions.
  1. +3 −0 lib/resourceful/resource.js
  2. +1 −1 package.json
  3. +1 −1 test/engines/couchdb-relationship-test.js
View
3 lib/resourceful/resource.js
@@ -147,6 +147,9 @@ Resource._request = function (/* method, [key, obj], callback */) {
};
Resource.get = function (id, callback) {
+ if (this.schema.properties._id && this.schema.properties._id.sanitize) {
+ id = this.schema.properties._id.sanitize(id);
+ }
return id
? this._request('get', id, callback)
: callback(new Error('key is undefined'));
View
2 package.json
@@ -17,6 +17,6 @@
},
"main": "./lib/resourceful",
"scripts": {
- "test": "vows --spec"
+ "test": "vows --spec -i"
}
}
View
2 test/engines/couchdb-relationship-test.js
@@ -85,7 +85,7 @@ vows.describe('resourceful/resource/relationship').addBatch({
},
"article should have a <author_id> property": function (Author, Article) {
assert.include(this.article,'author_id');
- assert.isUndefined(this.article.author_id);
+ assert.isNull(this.article.author_id);
},
"article should have a <author> method": function (Author, Article) {
assert.isFunction(this.article.author);

0 comments on commit 5e2d22b

Please sign in to comment.