|
|
|
@ -393,11 +393,20 @@ describe('Core base tests', function() { |
|
|
|
expect(OC.generateUrl('heartbeat')).toEqual(OC.webroot + '/index.php/heartbeat'); |
|
|
|
expect(OC.generateUrl('/heartbeat')).toEqual(OC.webroot + '/index.php/heartbeat'); |
|
|
|
}); |
|
|
|
it('substitutes parameters', function() { |
|
|
|
expect(OC.generateUrl('apps/files/download{file}', {file: '/Welcome.txt'})).toEqual(OC.webroot + '/index.php/apps/files/download/Welcome.txt'); |
|
|
|
it('substitutes parameters which are escaped by default', function() { |
|
|
|
expect(OC.generateUrl('apps/files/download/{file}', {file: '<">ImAnUnescapedString/!'})).toEqual(OC.webroot + '/index.php/apps/files/download/%3C%22%3EImAnUnescapedString%2F!'); |
|
|
|
}); |
|
|
|
it('substitutes parameters which can also be unescaped via option flag', function() { |
|
|
|
expect(OC.generateUrl('apps/files/download/{file}', {file: 'subfolder/Welcome.txt'}, {escape: false})).toEqual(OC.webroot + '/index.php/apps/files/download/subfolder/Welcome.txt'); |
|
|
|
}); |
|
|
|
it('substitutes multiple parameters which are escaped by default', function() { |
|
|
|
expect(OC.generateUrl('apps/files/download/{file}/{id}', {file: '<">ImAnUnescapedString/!', id: 5})).toEqual(OC.webroot + '/index.php/apps/files/download/%3C%22%3EImAnUnescapedString%2F!/5'); |
|
|
|
}); |
|
|
|
it('substitutes multiple parameters which can also be unescaped via option flag', function() { |
|
|
|
expect(OC.generateUrl('apps/files/download/{file}/{id}', {file: 'subfolder/Welcome.txt', id: 5}, {escape: false})).toEqual(OC.webroot + '/index.php/apps/files/download/subfolder/Welcome.txt/5'); |
|
|
|
}); |
|
|
|
it('doesnt error out with no params provided', function () { |
|
|
|
expect(OC.generateUrl('apps/files/download{file}')).toEqual(OC.webroot + '/index.php/apps/files/download{file}'); |
|
|
|
expect(OC.generateUrl('apps/files/download{file}')).toEqual(OC.webroot + '/index.php/apps/files/download%7Bfile%7D'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
describe('Main menu mobile toggle', function() { |
|
|
|
|