 describe 'Creating a box:', ->
   describe '( POST /<box_name> )', ->
     server = null
+    exec_stub = null
 
     before (done) ->
       server = require 'serv'
       mongoose.connect process.env['COBALT_DB']
       User.collection.drop()
       Box.collection.drop()
+      exec_stub = sinon.stub server, 'unix_user_add', (_a, cb) ->
+        cb null, null, null
       done()
 
     after (done) ->

    describe 'when the apikey is valid', ->
      froth = null
      response = null
      exec_stub = null
      apikey = "342709d1-45b0-4d2e-ad66-6fb81d10e34e"

      before (done) ->
        exec_stub = sinon.stub server, 'unix_user_add', (_a, cb) ->
          cb null, null, null

        froth = nock('https://scraperwiki.com')
        .get("/froth/check_key/#{apikey}")

          should.exist box
          done()

    describe 'when we use a naughty box name', ->
      froth = null
      response = null
      exec_stub = null
      apikey = "342709d1-45b0-4d2e-ad66-6fb81d10e34e"

      before (done) ->
        froth = nock('https://scraperwiki.com')
        .get("/froth/check_key/#{apikey}")
        .reply 200, "200", { 'content-type': 'text/plain' }

        options =
          uri: baseurl + 'box;with silly characters!'
          form:
            apikey: apikey

        request.post options, (err, resp, body) ->
            response = resp
            done()

      it "returns an error", ->
        response.statusCode.should.equal 404


    describe 'when the apikey is invalid', ->
      before ->
