/*global describe, it*/
require('../initialize-globals').load();
var Model = require('../../app/models/model').extend({
  validation: {
    firstName: {
      required: true
    }
  }
});
var ModelValidator = require('../../app/lib/model-validation-promise');
var model = new Model({
  firstName: "Pierre",
  lastName: "Besson"
});
describe('#model-validation-promise', function() {
  describe('##validation on metadatas', function() {
    it('should validate the metadatas');
  });
  describe('##validation on model', function() {
    it('The validation shoul be ok', function(done) {
      ModelValidator.validate(model).then(function(modelSuccess) {
        modelSuccess.toJSON().should.have.property('firstName', 'Pierre');
        done();
      });
    });
    it('The validation shoul be ko', function(done) {
      model.unset('firstName', {
        silent: true
      });
      ModelValidator.validate(model).
      catch (function(error) {
        error.should.have.property('firstName', 'firstName not valid.');
        done();
      });
    });
  });

});
/*global describe, it*/
require('../initialize-globals').load();
var Model = require('../../app/models/model').extend({
  validation: {
    firstName: {required: true}
  }
});
var ModelValidator = require('../../app/lib/model-validation-promise');
describe('default model', function() {
  var model = new Model({
    firstName: "Pierre",
    lastName: "Besson"
  });
  describe('#validate', function() {
    it('The validation shoul be ok', function(done) {
      ModelValidator.validate(model).then(function(modelSuccess) {
        modelSuccess.toJSON().should.have.property('firstName', 'Pierre');
        done();
      });
    });
    it('The validation shoul be ko', function(done) {
      model.unset('firstName', {silent: true});
      ModelValidator.validate(model).catch(function(error) {
          error.should.have.property('firstName', 'firstName not valid.');
        done();
      });
    });
  });
});


--- 
+++ 
@@ -2,16 +2,21 @@
 require('../initialize-globals').load();
 var Model = require('../../app/models/model').extend({
   validation: {
-    firstName: {required: true}
+    firstName: {
+      required: true
+    }
   }
 });
 var ModelValidator = require('../../app/lib/model-validation-promise');
-describe('default model', function() {
-  var model = new Model({
-    firstName: "Pierre",
-    lastName: "Besson"
+var model = new Model({
+  firstName: "Pierre",
+  lastName: "Besson"
+});
+describe('#model-validation-promise', function() {
+  describe('##validation on metadatas', function() {
+    it('should validate the metadatas');
   });
-  describe('#validate', function() {
+  describe('##validation on model', function() {
     it('The validation shoul be ok', function(done) {
       ModelValidator.validate(model).then(function(modelSuccess) {
         modelSuccess.toJSON().should.have.property('firstName', 'Pierre');
@@ -19,12 +24,15 @@
       });
     });
     it('The validation shoul be ko', function(done) {
-      model.unset('firstName', {silent: true});
-      ModelValidator.validate(model).catch(function(error) {
-          error.should.have.property('firstName', 'firstName not valid.');
+      model.unset('firstName', {
+        silent: true
+      });
+      ModelValidator.validate(model).
+      catch (function(error) {
+        error.should.have.property('firstName', 'firstName not valid.');
         done();
       });
     });
   });
+
 });
-
Add the metadata mock on the model validation.
