Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Commit

Permalink
fix(app): create new $scope for controller tests
Browse files Browse the repository at this point in the history
Creating new $scope for controller tests both is good practice and
prevents the grunt task failing on a clean install due to jshint
warnings.
  • Loading branch information
excentris committed Jul 2, 2015
1 parent 3eb78fe commit 1067645
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions templates/javascript/spec/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

describe('Controller: <%= classedName %>Ctrl', function () {
var scope;

// load the controller's module
beforeEach(module('<%= scriptAppName %>'));
Expand All @@ -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
});
}));
Expand Down

0 comments on commit 1067645

Please sign in to comment.