       msg.src = @id
       msg.seq = @seq
       @send(msg)
+    sendSubscribe: (collection, name, version)->
+      msg =  c:collection, d:name, src: @id, seq: @seq, a:'sub'
+      msg.v = version if version
+      @send msg
     id: '42'
     seq: 0
 

  textType = ottypes['http://sharejs.org/types/textv1']
  numberType = require('./support/ot_number')

  connection =
    state: 'connected'
    sent: []


    it 'sends subscription message', ->
      @doc.subscribe()
      expect(connection.sent[0].c).to.equal 'notes'
      expect(connection.sent[0].d).to.equal 'music'
      expect(connection.sent[0].a).to.equal 'sub'

    it 'retrives snapshot', ->
      @doc.subscribe()
