 Client = require('request-json').JsonClient
 app = require('../server')
 
-client = new Client("http://localhost:7000/")
+client = new Client("http://localhost:8888/")
 
 
 # connection to DB for "hand work"


describe "Indexation", ->

    # Clear DB, create a new one, then init data for tests.
    before (done) ->
        client.del "data/index/clear-all/", (err, response) ->
            db.destroy ->
                console.log 'DB destroyed'
                db.create ->
                    console.log 'DB recreated'
                    done()

    # Start application before starting tests.
    before (done) ->
        app.listen(8888)
        done()



    describe "indexing and searching", ->

            docType: "Note"

        client.post "data/", note, (error, response, body) ->
            console.log error if error
            client.post "data/index/#{body._id}",
                fields: ["title", "content"]
                , callback
