'use strict';

var mongoose = require('mongoose'),
    sinon = require('sinon');

var modelStub;

module.exports = {
    getControllerPath: function(controller) {
        return '../../../../server/controllers/' + controller;
    },
    restoreModel: function() {
        modelStub.restore();
    },
    setModuleLocalVariable: function(moduleObject, variableName, variableValue) {
        moduleObject.__set__(variableName, variableValue);
    },
    stubModel: function() {
        modelStub = sinon.stub(mongoose, 'model', function() {});
    }
};

@@ -92,137 +92,339 @@
 Stub
-;%0A%0Amodule.exports = %7B%0A    getControllerPath: function(controller) %7B%0A        return '../../../../server/controllers/' + controller
+,%0A    getUnitPath = function(unitType, unitName) %7B%0A        return '../../../../server/' + unitType + '/' + unitName;%0A    %7D;%0A%0Amodule.exports = %7B%0A    getControllerPath: function(controller) %7B%0A        return getUnitPath('controllers', controller);%0A    %7D,%0A    getModelPath: function(model) %7B%0A        return getUnitPath('models', model)
 ;%0A  

extend the testing environment to test models