         done()
 
   it 'should not return private data for non owner', (done) ->
-    request(app)
-      .get('/steder/52407fb375049e5615000170?api_key=nrk')
+    req.get('/steder/52407fb375049e5615000170?api_key=nrk')
       .end (err, res) ->
         assert.equal res.statusCode, 200
         assert.equal typeof res.body, 'object'


describe 'GET', ->
  it 'should return 404 for missing document', (done) ->
    request(app)
      .get('/steder/53507fb375049e5615000181?api_key=dnt')
      .end (err, res) ->
        assert.equal res.statusCode, 404
        assert.deepEqual res.body, message: 'Not Found'
        done()

  it 'should return 200 for public document', (done) ->
    request(app)
      .get('/steder/52407fb375049e5615000170?api_key=dnt')
      .end (err, res) ->
        assert.equal res.statusCode, 200
        assert.equal typeof res.body, 'object'

        done()

  it 'should return 200 for private document for owner', (done) ->
    req.get('/steder/52d65b2544db971c94b2d949?api_key=dnt')
      .end (err, res) ->
        assert.equal res.statusCode, 200
        assert.equal typeof res.body, 'object'
