diff options
Diffstat (limited to 'test/servicesSpec.js')
| -rw-r--r-- | test/servicesSpec.js | 15 | 
1 files changed, 11 insertions, 4 deletions
| 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'}; | 
