aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests/js/filesSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/tests/js/filesSpec.js')
-rw-r--r--apps/files/tests/js/filesSpec.js17
1 files changed, 3 insertions, 14 deletions
diff --git a/apps/files/tests/js/filesSpec.js b/apps/files/tests/js/filesSpec.js
index 7f8848619f5..4f8d5a29318 100644
--- a/apps/files/tests/js/filesSpec.js
+++ b/apps/files/tests/js/filesSpec.js
@@ -19,8 +19,9 @@
*
*/
-/* global OC, Files */
-describe('Files tests', function() {
+describe('OCA.Files.Files tests', function() {
+ var Files = OCA.Files.Files;
+
describe('File name validation', function() {
it('Validates correct file names', function() {
var fileNames = [
@@ -83,18 +84,6 @@ describe('Files tests', function() {
});
});
describe('getDownloadUrl', function() {
- var curDirStub;
- beforeEach(function() {
- curDirStub = sinon.stub(FileList, 'getCurrentDirectory');
- });
- afterEach(function() {
- curDirStub.restore();
- });
- it('returns the ajax download URL when only filename specified', function() {
- curDirStub.returns('/subdir');
- var url = Files.getDownloadUrl('test file.txt');
- expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20file.txt');
- });
it('returns the ajax download URL when filename and dir specified', function() {
var url = Files.getDownloadUrl('test file.txt', '/subdir');
expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20file.txt');