diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-06 00:26:57 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-06 00:26:57 +0100 |
commit | b46517f0129345e2199e160c73f418a0db1d509f (patch) | |
tree | 8a5701d95640a761df3b5596a4babcfac8d1011f /core | |
parent | 8e667d1934d6bd9b4344ac624fdd2846c89abb0a (diff) | |
download | nextcloud-server-b46517f0129345e2199e160c73f418a0db1d509f.tar.gz nextcloud-server-b46517f0129345e2199e160c73f418a0db1d509f.zip |
adding js unit tests for OC.generateUrl()
Diffstat (limited to 'core')
-rw-r--r-- | core/js/tests/specs/coreSpec.js | 9 |
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'); + }); + }); }); |