|
|
|
@ -42,16 +42,16 @@ describe('Core base tests', function() {
|
|
|
|
|
describe('Base values', function() {
|
|
|
|
|
it('Sets webroots', function() {
|
|
|
|
|
expect(OC.getRootPath()).toBeDefined();
|
|
|
|
|
expect(OC.appswebroots).toBeDefined();
|
|
|
|
|
expect(window._oc_appswebroots).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
describe('filePath', function() {
|
|
|
|
|
beforeEach(function() {
|
|
|
|
|
OC.webroot = 'http://localhost';
|
|
|
|
|
OC.appswebroots.files = OC.getRootPath() + '/apps3/files';
|
|
|
|
|
window._oc_webroot = 'http://localhost';
|
|
|
|
|
window._oc_appswebroots.files = OC.getRootPath() + '/apps3/files';
|
|
|
|
|
});
|
|
|
|
|
afterEach(function() {
|
|
|
|
|
delete OC.appswebroots.files;
|
|
|
|
|
delete window._oc_appswebroots.files;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('Uses a direct link for css and images,' , function() {
|
|
|
|
@ -70,11 +70,11 @@ describe('Core base tests', function() {
|
|
|
|
|
var TESTAPP_ROOT = OC.getRootPath() + '/appsx/testapp';
|
|
|
|
|
|
|
|
|
|
beforeEach(function() {
|
|
|
|
|
OC.appswebroots[TESTAPP] = TESTAPP_ROOT;
|
|
|
|
|
window._oc_appswebroots[TESTAPP] = TESTAPP_ROOT;
|
|
|
|
|
});
|
|
|
|
|
afterEach(function() {
|
|
|
|
|
// restore original array
|
|
|
|
|
delete OC.appswebroots[TESTAPP];
|
|
|
|
|
delete window._oc_appswebroots[TESTAPP];
|
|
|
|
|
});
|
|
|
|
|
it('Generates correct links for core apps', function() {
|
|
|
|
|
expect(OC.linkTo('core', 'somefile.php')).toEqual(OC.getRootPath() + '/core/somefile.php');
|
|
|
|
|