Fix #1639 logs error in mocha phantom js

This commit is contained in:
Nicolas Le Goff
2014-02-13 11:49:46 +01:00
parent db1a23fe34
commit fe2300e6ca
3 changed files with 16 additions and 4 deletions

View File

@@ -7,7 +7,10 @@ module.exports = function(grunt) {
},
mocha_phantomjs: {
options: {
'reporter': 'dot'
'reporter': 'dot',
'setting': [
'loadImages=false'
]
},
all: ['www/scripts/tests/index.html']
},

View File

@@ -20,8 +20,8 @@ define([
"apps/admin/fields/views/fieldError",
"apps/admin/fields/errors/errorManager"
], function ($, _, Backbone, i18n, FieldsCollection, VocabulariesCollection, DcFieldsCollection, FieldListView, SaveView, FieldErrorView, ErrorManager) {
var initialize = function () {
AdminFieldApp = {
var create = function () {
window.AdminFieldApp = {
$window: $(window),
$scope: $("#admin-field-app"),
$top: $(".row-top", this.$scope),
@@ -58,7 +58,9 @@ define([
});
AdminFieldApp.vocabularyCollection = new VocabulariesCollection();
AdminFieldApp.dcFieldsCollection = new DcFieldsCollection();
};
var load = function() {
// load strings
i18n.init({resGetPath: "/admin/fields/language.json"});
@@ -101,7 +103,14 @@ define([
);
};
var initialize = function () {
create();
load();
};
return {
create: create,
load: load,
initialize: initialize
};
});

View File

@@ -25,7 +25,7 @@ define([
$("body").append(fixtures.read('admin/fields/dom', 'admin/fields/templates'));
var sbasId = 1;
App.initialize();
App.create();
describe("Admin field", function () {
describe("Initialization", function () {