aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/routeSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-09-08 13:56:29 -0700
committerIgor Minar2011-10-11 11:01:45 -0700
commit4f78fd692c0ec51241476e6be9a4df06cd62fdd6 (patch)
tree91f70bb89b9c095126fbc093f51cedbac5cb0c78 /test/service/routeSpec.js
parentdf6d2ba3266de405ad6c2f270f24569355706e76 (diff)
downloadangular.js-4f78fd692c0ec51241476e6be9a4df06cd62fdd6.tar.bz2
feat(forms): new and improved forms
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');