aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js12
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'});