[Pkg-owncloud-commits] [owncloud] 226/258: Add unittest for filePath
David Prévot
taffit at moszumanska.debian.org
Sat Oct 11 17:22:39 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 335ad56ff87d8fbc56d1f7f4524f73032ded9494
Author: Lukas Reschke <lukas at owncloud.com>
Date: Tue Sep 9 12:05:19 2014 +0200
Add unittest for filePath
---
core/js/tests/specs/coreSpec.js | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 166210d..984ecd4 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';
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list