                 client.post "login", password: password, \
                             (error, response, body) ->
                     done()
+
+    before ->
+        @haibu = fakeServer { drone: { port: 8001 } }, 200, (body) ->
+            should.exist body.start.user
+            should.exist body.start.name
+            should.exist body.start.repository
+            should.exist body.start.scripts
+        @haibu.listen(9002)
+        @proxy = fakeServer msg: "ok", 201, (body) ->
+            should.exist body.route
+            should.exist body.port
+            body.route.should.equal "/apps/my-app/"
+            body.port.should.equal 8001
+        @proxy.listen(4000)
+
+    after ->
+        @haibu.close()
+        @proxy.close()
+
 
     describe "GET /api/applications Get all applications", ->
         it "When I send a request to retrieve all applications", (done) ->

    createApp()


describe "Applications", ->

    before (done) ->
        server.listen(8888)

http = require('http')
should = require('chai').Should()
client = require('../common/test/client')
server = require('../server')
