 
 describe 'PUT', ->
   it 'should return 403 for non owner', (done) ->
-    request(app)
-      .put('/steder/52407fb375049e5615000170?api_key=nrk')
+    req.put('/steder/52407fb375049e5615000170?api_key=nrk')
       .end (err, res) ->
         assert.equal res.statusCode, 403
         assert.deepEqual res.body, message: 'Request Denied'
         done()
 
   it 'should return 200 for owner', (done) ->
-    request(app)
-      .put('/steder/52407fb375049e5615000170?api_key=dnt')
+    req.put('/steder/52407fb375049e5615000170?api_key=dnt')
       .send(navn: 'Foo')
       .end (err, res) ->
         assert.equal res.statusCode, 200


describe 'HEAD', ->
  it 'should return 404 with no body for missing document', (done) ->
    request(app)
      .head('/steder/53507fb375049e5615000181?api_key=dnt')
      .end (err, res) ->
        assert.equal res.statusCode, 404
        assert.deepEqual res.body, {}
        done()

  it 'should return 200 with no body for existing document', (done) ->
    request(app)
      .head('/steder/52407fb375049e5615000170?api_key=dnt')
      .end (err, res) ->
        assert.equal res.statusCode, 200
        assert.deepEqual res.body, {}

        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'
