diff --git a/UnitTests/Makefile.unittests b/UnitTests/Makefile.unittests index aec36e9e45..20b5a015c2 100755 --- a/UnitTests/Makefile.unittests +++ b/UnitTests/Makefile.unittests @@ -314,6 +314,7 @@ SHELL_SERVER_ONLY = \ @top_srcdir@/js/server/tests/transactions.js \ @top_srcdir@/js/server/tests/routing.js \ @top_srcdir@/js/common/tests/shell-foxx.js \ + @top_srcdir@/js/common/tests/shell-foxx-repository.js \ @top_srcdir@/js/common/tests/shell-graph-traversal.js \ @top_srcdir@/js/common/tests/shell-graph-algorithms.js \ @top_srcdir@/js/common/tests/shell-graph-measurement.js \ diff --git a/js/common/tests/shell-foxx-repository.js b/js/common/tests/shell-foxx-repository.js new file mode 100644 index 0000000000..de31523f3d --- /dev/null +++ b/js/common/tests/shell-foxx-repository.js @@ -0,0 +1,40 @@ +require("internal").flushModuleCache(); + +var jsunity = require("jsunity"), + FoxxRepository = require('org/arangodb/foxx/repository').Repository; + +function RepositorySpec () { + var TestRepository, instance, prefix, collection, modelPrototype; + + return { + setUp: function () { + prefix = "myApp"; + collection = function () {}; + modelPrototype = function () {}; + }, + + testWasInitialized: function () { + instance = new FoxxRepository(prefix, collection, modelPrototype); + + assertEqual(instance.prefix, prefix); + assertEqual(instance.collection, collection); + assertEqual(instance.modelPrototype, modelPrototype); + }, + + testAddingAMethodWithExtend: function () { + TestRepository = FoxxRepository.extend({ + test: function() { + return "test"; + } + }); + + instance = new TestRepository(prefix, collection, modelPrototype); + + assertEqual(instance.test(), "test"); + } + }; +} + +jsunity.run(RepositorySpec); + +return jsunity.done(); diff --git a/js/common/tests/shell-foxx.js b/js/common/tests/shell-foxx.js index fc8797798a..2dcb20dcd2 100644 --- a/js/common/tests/shell-foxx.js +++ b/js/common/tests/shell-foxx.js @@ -842,39 +842,6 @@ function ModelSpec () { }; } -function RepositorySpec () { - var FoxxRepository, TestRepository, instance, prefix, collection, modelPrototype; - - return { - setUp: function () { - FoxxRepository = require('org/arangodb/foxx').Repository; - prefix = "myApp"; - collection = function () {}; - modelPrototype = function () {}; - }, - - testWasInitialized: function () { - instance = new FoxxRepository(prefix, collection, modelPrototype); - - assertEqual(instance.prefix, prefix); - assertEqual(instance.collection, collection); - assertEqual(instance.modelPrototype, modelPrototype); - }, - - testAddingAMethodWithExtend: function () { - TestRepository = FoxxRepository.extend({ - test: function() { - return "test"; - } - }); - - instance = new TestRepository(prefix, collection, modelPrototype); - - assertEqual(instance.test(), "test"); - } - }; -} - jsunity.run(CreateFoxxApplicationSpec); jsunity.run(SetRoutesFoxxApplicationSpec); jsunity.run(DocumentationAndConstraintsSpec); @@ -884,6 +851,5 @@ jsunity.run(BaseMiddlewareWithTemplateSpec); jsunity.run(ViewHelperSpec); jsunity.run(FormatMiddlewareSpec); jsunity.run(ModelSpec); -jsunity.run(RepositorySpec); return jsunity.done(); diff --git a/js/server/modules/org/arangodb/foxx/repository.js b/js/server/modules/org/arangodb/foxx/repository.js index 5e9052ecfe..21c557a0b2 100644 --- a/js/server/modules/org/arangodb/foxx/repository.js +++ b/js/server/modules/org/arangodb/foxx/repository.js @@ -2,7 +2,7 @@ /*global module, require, exports */ //////////////////////////////////////////////////////////////////////////////// -/// @brief Foxx application +/// @brief Foxx Repository /// /// @file ///