]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add beforeeach and aftereach
authorLukas Reschke <lukas@owncloud.com>
Tue, 9 Sep 2014 11:08:50 +0000 (13:08 +0200)
committerLukas Reschke <lukas@owncloud.com>
Tue, 9 Sep 2014 11:08:50 +0000 (13:08 +0200)
core/js/tests/specs/coreSpec.js

index 2ad1eb7623bc5a8f6deeefcd0cf42b326dd12b62..5db79ef2c561a3dc176984245038be954ba647f9 100644 (file)
@@ -135,19 +135,21 @@ describe('Core base tests', function() {
                });
        });
        describe('filePath', function() {
-               it('Uses a direct link for css and images,' , function() {
+               beforeEach(function() {
                        OC.webroot = 'http://localhost';
                        OC.appswebroots['files'] = OC.webroot + '/apps3/files';
+               });
+               afterEach(function() {
+                       delete OC.appswebroots['files'];
+               });
 
+               it('Uses a direct link for css and images,' , function() {
                        expect(OC.filePath('core', 'css', 'style.css')).toEqual('http://localhost/core/css/style.css');
                        expect(OC.filePath('files', 'css', 'style.css')).toEqual('http://localhost/apps3/files/css/style.css');
                        expect(OC.filePath('core', 'img', 'image.png')).toEqual('http://localhost/core/img/image.png');
                        expect(OC.filePath('files', 'img', 'image.png')).toEqual('http://localhost/apps3/files/img/image.png');
                });
                it('Routes PHP files via index.php,' , function() {
-                       OC.webroot = 'http://localhost';
-                       OC.appswebroots['files'] = OC.webroot + '/apps3/files';
-
                        expect(OC.filePath('core', 'ajax', 'test.php')).toEqual('http://localhost/index.php/core/ajax/test.php');
                        expect(OC.filePath('files', 'ajax', 'test.php')).toEqual('http://localhost/index.php/apps/files/ajax/test.php');
                });