Refactor code.

This commit is contained in:
Lars Jung 2015-05-02 20:16:48 +02:00
parent 16186811a4
commit 167e30dee1
4 changed files with 10 additions and 10 deletions

View file

@ -19,7 +19,7 @@ describe('module \'' + ID + '\'', function () {
setup: {
APP_HREF: util.uniqId(),
ROOT_HREF: util.uniqId(),
CURRENT_HREF: util.uniqId()
VERSION: util.uniqId()
}
};
this.applyFn = function () {
@ -101,12 +101,12 @@ describe('module \'' + ID + '\'', function () {
});
});
describe('.currentHref', function () {
describe('.version', function () {
it('set correct', function () {
var instance = this.applyFn();
assert.strictEqual(instance.currentHref, this.xConfig.setup.CURRENT_HREF);
assert.strictEqual(instance.version, this.xConfig.setup.VERSION);
});
});
});

View file

@ -2,7 +2,7 @@
'use strict';
var ID = 'view/topbar';
var DEPS = ['$', 'config', 'view/root'];
var DEPS = ['$', 'core/settings', 'view/root'];
describe('module \'' + ID + '\'', function () {
@ -10,11 +10,11 @@ describe('module \'' + ID + '\'', function () {
this.definition = modulejs._private.definitions[ID];
this.xConfig = {setup: {VERSION: util.uniqId()}};
this.xSettings = {version: util.uniqId()};
this.xRoot = {$el: null};
this.applyFn = function () {
return this.definition.fn($, this.xConfig, this.xRoot);
return this.definition.fn($, this.xSettings, this.xRoot);
};
});
@ -104,7 +104,7 @@ describe('module \'' + ID + '\'', function () {
it('#backlink has correct title', function () {
this.applyFn();
assert.strictEqual($('#backlink').attr('title'), 'powered by h5ai ' + this.xConfig.setup.VERSION);
assert.strictEqual($('#backlink').attr('title'), 'powered by h5ai ' + this.xSettings.version);
});
it('#backlink has correct text', function () {