 
 
 describe "Existence", ->
-    describe "Check Existence of a Note that does not exist in database", ->
-        it "When I send a request to check existence of Note with id 123", \
+    describe "Check Existence of a Document that does not exist in database", ->
+        before ->
+            delete @body
+            delete @response
+
+        it "When I send a request to check existence of Document with id 123", \
                 (done) ->
             client.get "data/exist/123/", (error, response, body) =>
                 response.should.be.json

db = connection.database('cozy')



before (done) ->
    # Prepare database for tests
    db.save '321', {"value":"val"} # insert id 321 : Existence

    # start app
    app.listen(8888)

        it "Then error 404 should be returned", ->
            @response.statusCode.should.equal(404)

    describe "Find a Document that does exist in database", ->
        before ->
            delete @body
            delete @response

        it "When I send a request to get Document with id 321", (done) ->
            client.get 'data/321/', (error, response, body) =>
                response.should.be.json
                response.statusCode.should.equal(200)
