aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/routeSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2012-02-15 21:49:07 -0800
committerVojta Jina2012-02-28 17:46:58 -0800
commite31d1c287d972d633bdaf9c385d3012192f64918 (patch)
tree8d975aecfcc56b049ded9d3a18f2f226d2c490fd /test/service/routeSpec.js
parentf16bd2f747ed94547eabdc4c337775a22a365255 (diff)
downloadangular.js-e31d1c287d972d633bdaf9c385d3012192f64918.tar.bz2
refactor($route): remove .parent(); ng:view scope creation
Diffstat (limited to 'test/service/routeSpec.js')
-rw-r--r--test/service/routeSpec.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/service/routeSpec.js b/test/service/routeSpec.js
index 6c6828bc..97532f38 100644
--- a/test/service/routeSpec.js
+++ b/test/service/routeSpec.js
@@ -1,6 +1,20 @@
'use strict';
describe('$route', function() {
+
+ beforeEach(module(function() {
+ return function($rootScope, $controller) {
+ $rootScope.$on('$afterRouteChange', function(event, next) {
+ // emulate ng:view scope creation
+ if (next) {
+ next.scope = $rootScope.$new();
+ next.controller && $controller(next.controller, {$scope: next.scope});
+ }
+ });
+ };
+ }));
+
+
it('should route and fire change event', function() {
var log = '',
lastRoute,