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: { mocha_phantomjs: {
options: { options: {
'reporter': 'dot' 'reporter': 'dot',
'setting': [
'loadImages=false'
]
}, },
all: ['www/scripts/tests/index.html'] all: ['www/scripts/tests/index.html']
}, },

View File

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

View File

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