aboutsummaryrefslogtreecommitdiffstats
path: root/test/servicesSpec.js
diff options
context:
space:
mode:
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');
+
+ });
+});