       it 'should respond with an error if this.done() isn\'t called after response is handled manually', (test, next) ->
         Restivus.addRoute 'testManualResponseWithoutDone',
           get: ->
-            undefined
+            @response.write 'Testing'
 
         HTTP.get 'http://localhost:3000/api/v1/testManualResponseWithoutDone', (error, result) ->
           test.isTrue error

          get: ->
            @response.write 'Testing '
            @response.write 'chunked response.'
#            @done()

        HTTP.get 'http://localhost:3000/api/v1/testChunkedResponse', (error, result) ->
          response = result.content

          test.equal response.message, 'API endpoint not found'
          next()

      context 'with the default autogenerated endpoints', ->
        Restivus.addCollection new Mongo.Collection('testautogen')
        testId = null

        it 'should support a POST on api/collection', (test) ->
          result = HTTP.post 'http://localhost:3000/api/v1/testAutogen',
            data:
              name: 'test name'
              description: 'test description'
          response = JSON.parse result.content
          responseData = response.data
          test.equal result.statusCode, 201
          test.equal response.status, 'success'
          test.equal responseData.name, 'test name'
          test.equal responseData.description, 'test description'

          # Persist the new resource id
          testId = responseData._id


        it 'should support a PUT on api/collection/:id', (test) ->
          result = HTTP.put "http://localhost:3000/api/v1/testAutogen/#{testId}",
            data:
              name: 'update name'
              description: 'update description'
          response = JSON.parse result.content
          responseData = response.data
          test.equal result.statusCode, 200
          test.equal response.status, 'success'
          test.equal responseData.name, 'update name'
          test.equal responseData.description, 'update description'

          result = HTTP.put "http://localhost:3000/api/v1/testAutogen/#{testId}",
            data:
              name: 'update name with no description'
          response = JSON.parse result.content
          responseData = response.data
          test.equal result.statusCode, 200
          test.equal response.status, 'success'
          test.equal responseData.name, 'update name with no description'
          test.isUndefined responseData.description


    describe 'An endpoint', ->

      it 'should cause an error when it returns null', (test, next) ->
