diff --git a/js/server/tests/shell-foxx-model.js b/js/server/tests/shell-foxx-model.js index 497ddc8435..13c105d425 100644 --- a/js/server/tests/shell-foxx-model.js +++ b/js/server/tests/shell-foxx-model.js @@ -59,7 +59,7 @@ function ModelSpec () { assertEqual(instance.get("a"), 1); }, - testFromDB: function () { + testFromDb: function () { var doc = require("org/arangodb").db._users.any(); assertEqual(typeof doc._PRINT, 'function'); instance = new FoxxModel(doc); @@ -67,6 +67,17 @@ function ModelSpec () { assertFalse(instance.has('_PRINT')); }, + testFromDbWithSchema: function () { + var Model = FoxxModel.extend({ + user: joi.string() + }); + var doc = require("org/arangodb").db._users.any(); + assertEqual(typeof doc._PRINT, 'function'); + instance = new Model(doc); + assertEqual(instance.attributes._PRINT, undefined); + assertFalse(instance.has('_PRINT')); + }, + testSettingMultipleAttributes: function () { instance = new FoxxModel({ a: 1,