Skip to content

Commit

Permalink
LifeEventValidator. Removed LiveEventController tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Nov 29, 2015
1 parent 084323c commit 301a23e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Empty file.
18 changes: 18 additions & 0 deletions test/unit/validator/lifeEventValidator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = validate;

var should = require('should');

function validate(lifeEvent) {
if(lifeEvent instanceof Array) {
lifeEvent.forEach(validatelifeEvent);
} else {
validatelifeEvent(lifeEvent);
}
}

function validatelifeEvent(lifeEvent) {
lifeEvent.should.be.instanceOf(Object);
lifeEvent.should.have.property('datetime');
lifeEvent.should.have.property('user');
lifeEvent.should.have.property('eventtype');
}

0 comments on commit 301a23e

Please sign in to comment.