Skip to content

Commit 009dd14

Browse files
Chris Moultriepetebacondarwin
authored andcommitted
test(controllers): use $controller to get hold of a controller for testing
Closes angular#75
1 parent 99b1ed9 commit 009dd14

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/unit/controllersSpec.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ describe('controllers', function(){
66
beforeEach(module('myApp.controllers'));
77

88

9-
it('should ....', inject(function() {
9+
it('should ....', inject(function($controller) {
1010
//spec body
11+
var myCtrl1 = $controller('MyCtrl1');
12+
expect(myCtrl1).toBeDefined();
1113
}));
1214

13-
it('should ....', inject(function() {
15+
it('should ....', inject(function($controller) {
1416
//spec body
17+
var myCtrl2 = $controller('MyCtrl2');
18+
expect(myCtrl2).toBeDefined();
1519
}));
1620
});

0 commit comments

Comments
 (0)