summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-09-09 12:05:19 +0200
committerLukas Reschke <lukas@owncloud.com>2014-09-09 12:05:19 +0200
commitcabd70148f4b78d580712364a3bee00c35e60bba (patch)
treeec3dd8860b54c90ff5ac75e8cd9e2fe578e95da2 /core
parente7e5333b1239b84aa166d41231ae711a43eb72d9 (diff)
downloadnextcloud-server-cabd70148f4b78d580712364a3bee00c35e60bba.tar.gz
nextcloud-server-cabd70148f4b78d580712364a3bee00c35e60bba.zip
Add unittest for filePath
Diffstat (limited to 'core')
-rw-r--r--core/js/tests/specs/coreSpec.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index dd9d4a79277..2ad1eb7623b 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -134,6 +134,24 @@ describe('Core base tests', function() {
expect(escapeHTML('This is a good string without HTML.')).toEqual('This is a good string without HTML.');
});
});
+ describe('filePath', function() {
+ it('Uses a direct link for css and images,' , function() {
+ OC.webroot = 'http://localhost';
+ OC.appswebroots['files'] = OC.webroot + '/apps3/files';
+
+ expect(OC.filePath('core', 'css', 'style.css')).toEqual('http://localhost/core/css/style.css');
+ expect(OC.filePath('files', 'css', 'style.css')).toEqual('http://localhost/apps3/files/css/style.css');
+ expect(OC.filePath('core', 'img', 'image.png')).toEqual('http://localhost/core/img/image.png');
+ expect(OC.filePath('files', 'img', 'image.png')).toEqual('http://localhost/apps3/files/img/image.png');
+ });
+ it('Routes PHP files via index.php,' , function() {
+ OC.webroot = 'http://localhost';
+ OC.appswebroots['files'] = OC.webroot + '/apps3/files';
+
+ expect(OC.filePath('core', 'ajax', 'test.php')).toEqual('http://localhost/index.php/core/ajax/test.php');
+ expect(OC.filePath('files', 'ajax', 'test.php')).toEqual('http://localhost/index.php/apps/files/ajax/test.php');
+ });
+ });
describe('Link functions', function() {
var TESTAPP = 'testapp';
var TESTAPP_ROOT = OC.webroot + '/appsx/testapp';