diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-02-20 16:55:18 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-02-20 16:55:18 +0100 |
commit | 0624476aa19a63b1f4e35f35e151c3fc46cb697f (patch) | |
tree | 67e9ead3bfd44e7efe3f4a6d1325866075dbd702 /apps/files/tests | |
parent | f33d35cd073addb08c78a65b719c72eb5424434a (diff) | |
parent | ec45a3c0e2567c89729bc6fe8c996b7939025429 (diff) | |
download | nextcloud-server-0624476aa19a63b1f4e35f35e151c3fc46cb697f.tar.gz nextcloud-server-0624476aa19a63b1f4e35f35e151c3fc46cb697f.zip |
Merge branch 'master' into mimeicons-svg
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/js/fileactionsSpec.js | 2 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js index 8bbc1d3d141..ef7ddcb874a 100644 --- a/apps/files/tests/js/fileactionsSpec.js +++ b/apps/files/tests/js/fileactionsSpec.js @@ -69,7 +69,7 @@ describe('FileActions tests', function() { $tr.find('.action[data-action=Download]').click(); expect(redirectStub.calledOnce).toEqual(true); - expect(redirectStub.getCall(0).args[0]).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?files=test%20download%20File.txt&dir=%2Fsubdir&download'); + expect(redirectStub.getCall(0).args[0]).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20download%20File.txt'); redirectStub.restore(); }); }); diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index c26e65fc4de..8f4cb86ab4a 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -58,8 +58,15 @@ describe('FileList tests', function() { expect($tr.attr('data-permissions')).toEqual('31'); //expect($tr.attr('data-mime')).toEqual('httpd/unix-directory'); }); - it('returns correct download URL', function() { - expect(FileList.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?files=some%20file.txt&dir=%2Fsubdir&download'); - expect(FileList.getDownloadUrl('some file.txt', '/anotherpath/abc')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?files=some%20file.txt&dir=%2Fanotherpath%2Fabc&download'); + describe('Download Url', function() { + it('returns correct download URL for single files', function() { + expect(FileList.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=some%20file.txt'); + expect(FileList.getDownloadUrl('some file.txt', '/anotherpath/abc')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fanotherpath%2Fabc&files=some%20file.txt'); + $('#dir').val('/'); + expect(FileList.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=some%20file.txt'); + }); + it('returns correct download URL for multiple files', function() { + expect(FileList.getDownloadUrl(['a b c.txt', 'd e f.txt'])).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D'); + }); }); }); |