Created
January 26, 2014 22:18
-
-
Save rolaveric/8640200 to your computer and use it in GitHub Desktop.
AngularJS Unit Test: Controller, real scope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('Attaches the scope to itself', inject(function ($controller, $rootScope) { | |
var scope = $rootScope.$new(); | |
var ctrl = $controller('MyCtrl', "$scope": scope}); | |
expect(ctrl.scope).toBe(scope); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment