diff options
| author | Misko Hevery | 2010-04-01 14:10:28 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-04-01 14:10:28 -0700 |
| commit | 85f13d602e31424b2e2d18172872f14a24c31135 (patch) | |
| tree | 8389ab1a0dfd6b8717a1f0dc70a738deaca146c2 /test | |
| parent | 11a6431f8926c557f3c58408dacc98466e76cde1 (diff) | |
| download | angular.js-85f13d602e31424b2e2d18172872f14a24c31135.tar.bz2 | |
work on $location and autobind
Diffstat (limited to 'test')
| -rw-r--r-- | test/BinderTest.js | 4 | ||||
| -rw-r--r-- | test/servicesSpec.js | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/test/BinderTest.js b/test/BinderTest.js index 67800e62..9c5c5dc6 100644 --- a/test/BinderTest.js +++ b/test/BinderTest.js @@ -721,13 +721,13 @@ BinderTest.prototype.testItShouldSelectTheCorrectRadioBox = function() { var male = jqLite(c.node[0].childNodes[1]); female.click(); - assertEquals("female", c.scope.$get("sex")); + assertEquals("female", c.scope.sex); assertEquals(true, female[0].checked); assertEquals(false, male[0].checked); assertEquals("female", female.val()); male.click(); - assertEquals("male", c.scope.$get("sex")); + assertEquals("male", c.scope.sex); assertEquals(false, female[0].checked); assertEquals(true, male[0].checked); assertEquals("male", male.val()); diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 5a6bcedc..88cbc947 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -13,10 +13,17 @@ describe("services", function(){ expect(scope.$window).toEqual(window); }); - it("should inject $anchor", function(){ - scope.$anchor('#path?key=value'); - expect(scope.$anchor.path).toEqual("path"); - expect(scope.$anchor.param).toEqual({key:'value'}); + it("should inject $location", function(){ + scope.$location('http://host:1234/p/a/t/h?query=value#path?key=value'); + expect(scope.$location.href).toEqual("http://host:123/p/a/t/h?query=value#path?key=value"); + expect(scope.$location.protocol).toEqual("http"); + expect(scope.$location.host).toEqual("host"); + expect(scope.$location.port).toEqual("1234"); + expect(scope.$location.path).toEqual("/p/a/t/h"); + expect(scope.$location.search).toEqual({query:'value'}); + expect(scope.$location.hash).toEqual('path?key=value'); + expect(scope.$location.hashPath).toEqual('path'); + expect(scope.$location.hashSearch).toEqual({key:'value'}); scope.$anchor.path = 'page=http://path'; scope.$anchor.param = {k:'a=b'}; |
