       socketStub.on.withArgs('eventric:joinRoom').yields 'RoomName'
 
 
-    describe 'given no rpc request middleware', ->
-
-      it 'should join the room', ->
-        endpoint.initialize
-          ioInstance: ioStub
-        expect(socketStub.join).to.have.been.calledWith 'RoomName'
+    it 'should join the room', ->
+      endpoint.initialize
+        ioInstance: ioStub
+      expect(socketStub.join).to.have.been.calledWith 'RoomName'
 
 
     describe 'given a rpc request middleware', ->


      ioStub.to = sandbox.stub().returns channelStub

    describe 'given only a context name', ->

      it 'should emit an event with payload to the correct channel', ->
        payload = {}
        endpoint.publish 'context', payload

        expect(ioStub.to).to.have.been.calledWith 'context'
        expect(channelStub.emit).to.have.been.calledWith 'context', payload


    describe 'given a context name and event name', ->

      it 'should emit an event with payload to the correct channel', ->
        payload = {}
        endpoint.publish 'context', 'EventName', payload

        expect(ioStub.to).to.have.been.calledWith 'context/EventName'
        expect(channelStub.emit).to.have.been.calledWith 'context/EventName', payload


    describe 'given a context name, event name and aggregate id', ->

      it 'should emit an event with payload to the correct channel', ->
        payload = {}
        endpoint.publish 'context', 'EventName', '12345', payload

        expect(ioStub.to).to.have.been.calledWith 'context/EventName/12345'
        expect(channelStub.emit).to.have.been.calledWith 'context/EventName/12345', payload


  describe '#initialize', ->

    it 'should register a connection handler on the Socket.IO server', ->
      endpoint.initialize
        ioInstance: ioStub

