diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-07-13 17:41:20 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-11-22 16:05:50 +0100 |
commit | f20232d4bd3e78c4ea980aa03849c3f9bcf5b893 (patch) | |
tree | c23d4511baaf4df2d1c397326334d40f8455243a /apps/files_sharing/tests/js | |
parent | fa2be0750c50de45a2fd101eb23fa858c0e0771b (diff) | |
download | nextcloud-server-f20232d4bd3e78c4ea980aa03849c3f9bcf5b893.tar.gz nextcloud-server-f20232d4bd3e78c4ea980aa03849c3f9bcf5b893.zip |
Make public link share page work with Webdav and add operations
The public page now uses the public.php/webdav endpoint.
Also enabled more file operations like rename, move, delete and create
folder from the public page, which are now all possible thanks to the
public.php/webdav endpoint.
Diffstat (limited to 'apps/files_sharing/tests/js')
-rw-r--r-- | apps/files_sharing/tests/js/publicAppSpec.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/apps/files_sharing/tests/js/publicAppSpec.js b/apps/files_sharing/tests/js/publicAppSpec.js index d496b78acfa..8a644232e6c 100644 --- a/apps/files_sharing/tests/js/publicAppSpec.js +++ b/apps/files_sharing/tests/js/publicAppSpec.js @@ -21,11 +21,14 @@ describe('OCA.Sharing.PublicApp tests', function() { var App = OCA.Sharing.PublicApp; + var hostStub, portStub, protocolStub, webrootStub; var $preview; - var fileListIn; - var fileListOut; beforeEach(function() { + protocolStub = sinon.stub(OC, 'getProtocol').returns('https'); + hostStub = sinon.stub(OC, 'getHost').returns('example.com'); + portStub = sinon.stub(OC, 'getPort').returns(8080); + webrootStub = sinon.stub(OC, 'getRootPath').returns('/owncloud'); $preview = $('<div id="preview"></div>'); $('#testArea').append($preview); $preview.append( @@ -35,6 +38,13 @@ describe('OCA.Sharing.PublicApp tests', function() { ); }); + afterEach(function() { + protocolStub.restore(); + hostStub.restore(); + portStub.restore(); + webrootStub.restore(); + }); + describe('File list', function() { // TODO: this should be moved to a separate file once the PublicFileList is extracted from public.js beforeEach(function() { @@ -78,6 +88,12 @@ describe('OCA.Sharing.PublicApp tests', function() { App._initialized = false; }); + it('Uses public webdav endpoint', function() { + expect(fakeServer.requests.length).toEqual(1); + expect(fakeServer.requests[0].method).toEqual('PROPFIND'); + expect(fakeServer.requests[0].url).toEqual('https://sh4tok@example.com:8080/owncloud/public.php/webdav/subdir'); + }); + describe('Download Url', function() { var fileList; |