aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/routeSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/service/routeSpec.js')
-rw-r--r--test/service/routeSpec.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/service/routeSpec.js b/test/service/routeSpec.js
index c8c8cbeb..5aba2a1f 100644
--- a/test/service/routeSpec.js
+++ b/test/service/routeSpec.js
@@ -152,18 +152,18 @@ describe('$route', function() {
$location.path('/foo');
scope.$digest();
- expect(scope.$$childHead).toBeTruthy();
- expect(scope.$$childHead).toEqual(scope.$$childTail);
+ expect(scope.$$childHead.$id).toBeTruthy();
+ expect(scope.$$childHead.$id).toEqual(scope.$$childTail.$id);
$location.path('/bar');
scope.$digest();
- expect(scope.$$childHead).toBeTruthy();
- expect(scope.$$childHead).toEqual(scope.$$childTail);
+ expect(scope.$$childHead.$id).toBeTruthy();
+ expect(scope.$$childHead.$id).toEqual(scope.$$childTail.$id);
$location.path('/baz');
scope.$digest();
- expect(scope.$$childHead).toBeTruthy();
- expect(scope.$$childHead).toEqual(scope.$$childTail);
+ expect(scope.$$childHead.$id).toBeTruthy();
+ expect(scope.$$childHead.$id).toEqual(scope.$$childTail.$id);
$location.path('/');
scope.$digest();
@@ -172,6 +172,14 @@ describe('$route', function() {
});
+ it('should infer arguments in injection', function() {
+ $route.when('/test', {controller: function($route){ this.$route = $route; }});
+ $location.path('/test');
+ scope.$digest();
+ expect($route.current.scope.$route).toBe($route);
+ });
+
+
describe('redirection', function() {
it('should support redirection via redirectTo property by updating $location', function() {
var onChangeSpy = jasmine.createSpy('onChange');