summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-10-09 07:44:26 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2018-10-09 13:53:59 +0200
commit9af69ca2a5ed74acefdaedad6d189bdfd9e61e0e (patch)
treec755177c3886de1498010820b9a547a5314c8d41 /apps/files_sharing/tests
parent8b38b601e5bd07559bb86d38132be31820c41627 (diff)
downloadnextcloud-server-9af69ca2a5ed74acefdaedad6d189bdfd9e61e0e.tar.gz
nextcloud-server-9af69ca2a5ed74acefdaedad6d189bdfd9e61e0e.zip
Fix usage of deprecated OC.webroot
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/js/publicAppSpec.js12
-rw-r--r--apps/files_sharing/tests/js/sharedfilelistSpec.js20
2 files changed, 16 insertions, 16 deletions
diff --git a/apps/files_sharing/tests/js/publicAppSpec.js b/apps/files_sharing/tests/js/publicAppSpec.js
index 8ea339fd9de..dc9000af152 100644
--- a/apps/files_sharing/tests/js/publicAppSpec.js
+++ b/apps/files_sharing/tests/js/publicAppSpec.js
@@ -110,24 +110,24 @@ describe('OCA.Sharing.PublicApp tests', function() {
it('returns correct download URL for single files', function() {
expect(fileList.getDownloadUrl('some file.txt'))
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=some%20file.txt');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=some%20file.txt');
expect(fileList.getDownloadUrl('some file.txt', '/anotherpath/abc'))
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fanotherpath%2Fabc&files=some%20file.txt');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2Fanotherpath%2Fabc&files=some%20file.txt');
fileList.changeDirectory('/');
expect(fileList.getDownloadUrl('some file.txt'))
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2F&files=some%20file.txt');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%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/s/sh4tok/download?path=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D');
});
it('returns the correct ajax URL', function() {
expect(fileList.getAjaxUrl('test', {a:1, b:'x y'}))
- .toEqual(OC.webroot + '/index.php/apps/files_sharing/ajax/test.php?a=1&b=x%20y&t=sh4tok');
+ .toEqual(OC.getRootPath() + '/index.php/apps/files_sharing/ajax/test.php?a=1&b=x%20y&t=sh4tok');
});
it('returns correct download URL for downloading everything', function() {
expect(fileList.getDownloadUrl())
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2Fsubdir');
});
});
describe('Upload Url', function() {
diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js
index 0897e9c956d..c9e2bafcc23 100644
--- a/apps/files_sharing/tests/js/sharedfilelistSpec.js
+++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js
@@ -173,7 +173,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
@@ -193,7 +193,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).not.toBeDefined();
expect($tr.attr('data-tags')).toEqual('');
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/b.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('b.txt');
@@ -251,7 +251,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/index.php/apps/files' +
'?dir=/local%20path/local%20name'
);
@@ -272,7 +272,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).not.toBeDefined();
expect($tr.attr('data-tags')).toEqual('');
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/index.php/apps/files' +
'?dir=/b'
);
@@ -352,7 +352,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
@@ -394,7 +394,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/index.php/apps/files' +
'?dir=/local%20path/local%20name'
);
@@ -448,7 +448,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
+ OC.getRootPath() + '/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
@@ -519,7 +519,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
+ OC.getRootPath() + '/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
});
@@ -634,7 +634,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
+ OC.getRootPath() + '/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.attr('data-expiration')).toEqual('0');
expect($tr.find('td:last-child span').text()).toEqual('');
@@ -687,7 +687,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/local%20path/local%20name.txt');
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');