diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2014-03-06 15:07:28 +0100 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2014-03-06 15:07:28 +0100 |
commit | 5f0a22586f7b912694df268776e97e3cff5d659d (patch) | |
tree | 1da30832d01e211e518b3d798765c8ea6fb90d2f /core/js/tests | |
parent | 6e4ea09d52b23c216109d020dcceea5370817a73 (diff) | |
parent | b46517f0129345e2199e160c73f418a0db1d509f (diff) | |
download | nextcloud-server-5f0a22586f7b912694df268776e97e3cff5d659d.tar.gz nextcloud-server-5f0a22586f7b912694df268776e97e3cff5d659d.zip |
Merge pull request #7579 from owncloud/introduce-generateUrl-master
Introduce OC.generateUrl() in master
Diffstat (limited to 'core/js/tests')
-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 bb43810ef16..069546387c7 100644 --- a/core/js/tests/specs/coreSpec.js +++ b/core/js/tests/specs/coreSpec.js @@ -270,5 +270,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'); + }); + }); }); |