Ghost/ghost/admin/tests/unit/services/event-bus-test.js
Kevin Ansfield e74e2e039e Update code to match eslint rules
no issue
- switch `jscs` and `jshint` inline config to `eslint` config
- fix eslint errors, predominantly in tests where the config now the main app config more closely
2016-11-14 13:26:00 +00:00

38 lines
904 B
JavaScript

/* jshint expr:true */
import {expect} from 'chai';
import {
describeModule,
it
} from 'ember-mocha';
import sinon from 'sinon';
describeModule(
'service:event-bus',
'Unit: Service: event-bus',
{},
function() {
it('works', function () {
let service = this.subject();
let eventHandler = sinon.spy();
service.subscribe('test-event', eventHandler);
service.publish('test-event', 'test');
service.unsubscribe('test-event', eventHandler);
service.publish('test-event', 'test two');
expect(
eventHandler.calledOnce,
'event handler only triggered once'
).to.be.true;
expect(
eventHandler.calledWith('test'),
'event handler was passed correct arguments'
).to.be.true;
});
}
);