   describe 'EVENT unregister', ->
     describe 'when called with a valid request', ->
       beforeEach (done) ->
+        @eventForwarder.on 'message', (@message) =>
+          done() if @message.topic == 'unregister'
         @meshblu.register {}, (data) =>
           return done new Error data.error if data.error?
 
           @newDevice = data
           @meshblu.unregister uuid: @newDevice.uuid, (data) =>
             return done new Error data.error if data.error?
-            @eventForwarder.once 'message', (@message) =>
-              done()
 
       it 'should send a "unregister" message', ->
         expect(@message.topic).to.deep.equal 'unregister'

  describe 'EVENT device', ->
    describe 'when called with a valid request', ->
      beforeEach (done) ->
        @meshblu.device {uuid: @device.uuid}, (data) =>
          return done new Error(data.error) if data.error?
          @eventForwarder.once 'message', (@message) =>
            done()

      it 'should send a "devices" message', ->
        expect(@message.topic).to.deep.equal 'devices'

  describe 'EVENT resetToken', ->
    describe 'when called with a valid request', ->
      beforeEach (done) ->
        @eventForwarder.on 'message', (@message) =>
          done() if @message.topic == 'resettoken'
        @meshblu.register configWhitelist: ['*'], (data) =>
          return done new Error data.error if data.error?

          @newDevice = data
          @meshblu.resetToken @newDevice.uuid, (data) =>
            return done new Error data.error if data.error?

      it 'should send a "resettoken" message', ->
        expect(@message.topic).to.deep.equal 'resettoken'
