diff --git a/templates/javascript/spec/controller.js b/templates/javascript/spec/controller.js index 4f1bf51a9..d283ad1b4 100644 --- a/templates/javascript/spec/controller.js +++ b/templates/javascript/spec/controller.js @@ -1,6 +1,7 @@ 'use strict'; describe('Controller: <%= classedName %>Ctrl', function () { + var scope; // load the controller's module beforeEach(module('<%= scriptAppName %>')); @@ -9,7 +10,9 @@ describe('Controller: <%= classedName %>Ctrl', function () { // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { + scope = $rootScope.$new(); <%= classedName %>Ctrl = $controller('<%= classedName %>Ctrl', { + $scope: scope // place here mocked dependencies }); }));