Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-06 03:26:57 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-06 03:26:57 +0400
commitb46517f0129345e2199e160c73f418a0db1d509f (patch)
tree8a5701d95640a761df3b5596a4babcfac8d1011f /core
parent8e667d1934d6bd9b4344ac624fdd2846c89abb0a (diff)
adding js unit tests for OC.generateUrl()
Diffstat (limited to 'core')
-rw-r--r--core/js/tests/specs/coreSpec.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 478505e9287..d69e1fc7e25 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -276,5 +276,14 @@ describe('Core base tests', function() {
});
});
+ describe('Generate Url', function() {
+ it('returns absolute urls', function() {
+ expect(OC.generateUrl('heartbeat')).toEqual(OC.webroot + '/index.php/heartbeat');
+ expect(OC.generateUrl('/heartbeat')).toEqual(OC.webroot + '/index.php/heartbeat');
+ });
+ it('substitutes parameters', function() {
+ expect(OC.generateUrl('apps/files/download{file}', {file: '/Welcome.txt'})).toEqual(OC.webroot + '/index.php/apps/files/download/Welcome.txt');
+ });
+ });
});