     describe 'when authDevice yields a device', ->
       beforeEach ->
         @authDevice = sinon.stub().yields null, something: true
-        @sut = new MeshbluWebsocketHandler authDevice: @authDevice, MessageIOClient: @MessageIOClient
+        @sut = new MeshbluWebsocketHandler authDevice: @authDevice, MessageIOClient: @MessageIOClient, meshbluEventEmitter: @meshbluEventEmitter
         @sut.messageIOClient = @messageIOClient
         @sut.sendFrame = sinon.spy()
 

      beforeEach ->
        @authDevice = sinon.stub().yields null, uuid: '5555'
        @getDevices = sinon.stub().yields [{uuid: '5431', color: 'green', owner: '5555'}, {uuid: '1234', color: 'green', owner: '5555'}]
        @sut = new MeshbluWebsocketHandler authDevice: @authDevice, getDevices: @getDevices
        @sut.sendFrame = sinon.spy()

        @sut.mydevices color: 'green'

      beforeEach ->
        @authDevice = sinon.stub().yields null, something: true
        @unregisterDevice = sinon.spy()
        @sut = new MeshbluWebsocketHandler authDevice: @authDevice, unregisterDevice: @unregisterDevice, meshbluEventEmitter: @meshbluEventEmitter
        @sut.sendFrame = sinon.spy()

        @sut.unregister uuid: '1345'
