diff options
| author | Misko Hevery | 2012-02-15 21:49:07 -0800 |
|---|---|---|
| committer | Vojta Jina | 2012-02-28 17:46:58 -0800 |
| commit | e31d1c287d972d633bdaf9c385d3012192f64918 (patch) | |
| tree | 8d975aecfcc56b049ded9d3a18f2f226d2c490fd /test/widgetsSpec.js | |
| parent | f16bd2f747ed94547eabdc4c337775a22a365255 (diff) | |
| download | angular.js-e31d1c287d972d633bdaf9c385d3012192f64918.tar.bz2 | |
refactor($route): remove .parent(); ng:view scope creation
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index e762e7c0..3b245d11 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -633,6 +633,18 @@ describe('widget', function() { })); + it('should create controller instance on $afterRouteChange event', inject( + function($route, $rootScope) { + var controllerScope; + $route.current = { controller: function($scope) { controllerScope = $scope; } }; + $rootScope.$broadcast('$afterRouteChange', $route.current); + + expect(controllerScope.$parent.$id).toBe($rootScope.$id); + expect(controllerScope.$id).toBe($route.current.scope.$id); + } + )); + + it('should load content via xhr when route changes', function() { module(function($routeProvider) { $routeProvider.when('/foo', {template: 'myUrl1'}); |
