diff options
Diffstat (limited to 'apps/files_sharing/tests/js/publicAppSpec.js')
-rw-r--r-- | apps/files_sharing/tests/js/publicAppSpec.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/files_sharing/tests/js/publicAppSpec.js b/apps/files_sharing/tests/js/publicAppSpec.js index d496b78acfa..1ea5f7ed1bc 100644 --- a/apps/files_sharing/tests/js/publicAppSpec.js +++ b/apps/files_sharing/tests/js/publicAppSpec.js @@ -21,11 +21,13 @@ describe('OCA.Sharing.PublicApp tests', function() { var App = OCA.Sharing.PublicApp; + var hostStub, 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'); + webrootStub = sinon.stub(OC, 'getRootPath').returns('/owncloud'); $preview = $('<div id="preview"></div>'); $('#testArea').append($preview); $preview.append( @@ -35,6 +37,12 @@ describe('OCA.Sharing.PublicApp tests', function() { ); }); + afterEach(function() { + protocolStub.restore(); + hostStub.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 +86,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/owncloud/public.php/webdav/subdir'); + }); + describe('Download Url', function() { var fileList; |