From 11a6431f8926c557f3c58408dacc98466e76cde1 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 31 Mar 2010 17:56:16 -0700 Subject: started to add services --- test/servicesSpec.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/servicesSpec.js (limited to 'test/servicesSpec.js') diff --git a/test/servicesSpec.js b/test/servicesSpec.js new file mode 100644 index 00000000..5a6bcedc --- /dev/null +++ b/test/servicesSpec.js @@ -0,0 +1,27 @@ +describe("services", function(){ + var scope; + + beforeEach(function(){ + scope = createScope({ + $config: { + 'location': {'get':noop, 'set':noop, 'watch':noop} + } + }, serviceAdapter(angularService)); + }); + + it("should inject $window", 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'}); + + scope.$anchor.path = 'page=http://path'; + scope.$anchor.param = {k:'a=b'}; + + expect(scope.$anchor()).toEqual('page=http://path?k=a%3Db'); + + }); +}); -- cgit v1.2.3