2014-10-22 15:35:22 +02:00
|
|
|
var assert = require('assert');
|
|
|
|
var events = require('../lib/events');
|
2014-10-22 16:26:36 +02:00
|
|
|
var eventStore = require('../lib/eventStore');
|
2014-10-22 15:35:22 +02:00
|
|
|
|
2014-10-22 16:26:36 +02:00
|
|
|
describe('EventStore', function () {
|
2014-10-22 15:35:22 +02:00
|
|
|
describe('#create()', function () {
|
|
|
|
it('should emit event', function (done) {
|
2014-10-22 16:39:07 +02:00
|
|
|
eventStore.once(events.featureCreated, function (x) {
|
2014-10-22 15:35:22 +02:00
|
|
|
assert(x);
|
|
|
|
done();
|
|
|
|
}
|
|
|
|
);
|
2014-10-22 16:26:36 +02:00
|
|
|
eventStore.create({
|
2014-10-22 15:35:22 +02:00
|
|
|
'name': 'mail-server.validate-email-addresses',
|
|
|
|
'enabled': false,
|
|
|
|
'strategy': 'default',
|
|
|
|
'description': 'Feature description'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|