diff options
Diffstat (limited to 'test/ng/directive/ngViewSpec.js')
| -rw-r--r-- | test/ng/directive/ngViewSpec.js | 21 | 
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ng/directive/ngViewSpec.js b/test/ng/directive/ngViewSpec.js index e9d53110..3150c040 100644 --- a/test/ng/directive/ngViewSpec.js +++ b/test/ng/directive/ngViewSpec.js @@ -55,6 +55,27 @@ describe('ngView', function() {    }); +  it('should instantiate controller with an alias', function() { +    var log = [], controllerScope, +        Ctrl = function($scope) { +          this.name = 'alias'; +          controllerScope = $scope; +        }; + +    module(function($compileProvider, $routeProvider) { +      $routeProvider.when('/some', {templateUrl: '/tpl.html', controller: Ctrl, controllerAlias: 'ctrl'}); +    }); + +    inject(function($route, $rootScope, $templateCache, $location) { +      $templateCache.put('/tpl.html', [200, '<div></div>', {}]); +      $location.path('/some'); +      $rootScope.$digest(); + +      expect(controllerScope.ctrl.name).toBe('alias'); +    }); +  }); + +    it('should support string controller declaration', function() {      var MyCtrl = jasmine.createSpy('MyCtrl');  | 
