aboutsummaryrefslogtreecommitdiffstats
path: root/test/servicesSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2010-03-31 17:56:16 -0700
committerMisko Hevery2010-03-31 18:18:10 -0700
commit11a6431f8926c557f3c58408dacc98466e76cde1 (patch)
treeab36304fd373d0947ca36c577e25ca87a1c894af /test/servicesSpec.js
parent35a91085004e31f786df1e0011bc26ed0142ab4d (diff)
downloadangular.js-11a6431f8926c557f3c58408dacc98466e76cde1.tar.bz2
started to add services
Diffstat (limited to 'test/servicesSpec.js')
-rw-r--r--test/servicesSpec.js27
1 files changed, 27 insertions, 0 deletions
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');
+
+ });
+});