diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-06-06 15:13:02 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-06-06 15:17:55 +0200 |
commit | d3d0035a9a81ea5d3e314141069f4914e3c6ce54 (patch) | |
tree | 59e9fe9a626184ae1d1688a67116203607641e0a /apps/files/tests | |
parent | 933c05566e21c27e4f2d4b4e9c2d54e7b363d304 (diff) | |
download | nextcloud-server-d3d0035a9a81ea5d3e314141069f4914e3c6ce54.tar.gz nextcloud-server-d3d0035a9a81ea5d3e314141069f4914e3c6ce54.zip |
Use actual file path on rename/delete
When renaming or deleting a file that is in a subdirectory, performing
the action from the sharing overview or another file list view, the
actual directory of the file must be used instead of the current
directory.
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/js/fileactionsSpec.js | 3 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js index 490594a1773..355761afa01 100644 --- a/apps/files/tests/js/fileactionsSpec.js +++ b/apps/files/tests/js/fileactionsSpec.js @@ -140,6 +140,7 @@ describe('OCA.Files.FileActions tests', function() { id: 18, type: 'file', name: 'testName.txt', + path: '/somepath/dir', mimetype: 'text/plain', size: '1234', etag: 'a01234c', @@ -151,6 +152,8 @@ describe('OCA.Files.FileActions tests', function() { $tr.find('.action.delete').click(); expect(deleteStub.calledOnce).toEqual(true); + expect(deleteStub.getCall(0).args[0]).toEqual('testName.txt'); + expect(deleteStub.getCall(0).args[1]).toEqual('/somepath/dir'); deleteStub.restore(); }); it('passes context to action handler', function() { diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 7d3bc946dd3..e1a374146fe 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -485,7 +485,9 @@ describe('OCA.Files.FileList tests', function() { var $input, request; for (var i = 0; i < testFiles.length; i++) { - fileList.add(testFiles[i], {silent: true}); + var file = testFiles[i]; + file.path = '/some/subdir'; + fileList.add(file, {silent: true}); } // trigger rename prompt @@ -498,7 +500,7 @@ describe('OCA.Files.FileList tests', function() { expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; expect(request.url.substr(0, request.url.indexOf('?'))).toEqual(OC.webroot + '/index.php/apps/files/ajax/rename.php'); - expect(OC.parseQueryString(request.url)).toEqual({'dir': '/subdir', newname: 'Tu_after_three.txt', file: 'One.txt'}); + expect(OC.parseQueryString(request.url)).toEqual({'dir': '/some/subdir', newname: 'Tu_after_three.txt', file: 'One.txt'}); } it('Inserts renamed file entry at correct position if rename ajax call suceeded', function() { doRename(); |