 
     queue = [
 
-      ->
+      (next) ->
         # expecting username that has average character length to return 200
         validateUsernameRequestParams = generateValidateUsernameRequestParams
           body       :
             username : generateRandomString Math.round (maxLength + minLength) / 2
 
         request.post validateUsernameRequestParams, (err, res, body) ->
-          expect(err)             .to.not.exist
-          expect(res.statusCode)  .to.be.equal 200
-          expect(body)            .to.be.equal expectedBody
-          queue.next()
+          expect(err).to.not.exist
+          expect(res.statusCode).to.be.equal 200
+          expect(body).to.be.equal expectedBody
+          next()
 
-      ->
+      (next) ->
         # expecting username that has minimum character length to return 200
         validateUsernameRequestParams = generateValidateUsernameRequestParams
           body       :
             username : generateRandomString minLength
 
         request.post validateUsernameRequestParams, (err, res, body) ->
-          expect(err)             .to.not.exist
-          expect(res.statusCode)  .to.be.equal 200
-          expect(body)            .to.be.equal expectedBody
-          queue.next()
+          expect(err).to.not.exist
+          expect(res.statusCode).to.be.equal 200
+          expect(body).to.be.equal expectedBody
+          next()
 
-      ->
+      (next) ->
         # expecting username that has maximum character length to return 200
         validateUsernameRequestParams = generateValidateUsernameRequestParams
           body       :

      body       :
        username : generateRandomUsername()

    queue       = []
    methods     = ['put', 'patch', 'delete']

    addRequestToQueue = (queue, method) -> queue.push ->
      validateUsernameRequestParams.method = method
      request validateUsernameRequestParams, (err, res, body) ->
        expect(err)             .to.not.exist
        expect(res.statusCode)  .to.be.equal 404
        queue.next()

    for method in methods
      addRequestToQueue queue, method

    queue.push -> done()

    daisy queue


  it 'should send HTTP 400 if username is not set', (done) ->

    validateUsernameRequestParams       = generateValidateUsernameRequestParams()
    validateUsernameRequestParams.body  = null

    request.post validateUsernameRequestParams, (err, res, body) ->
      expect(err)             .to.not.exist
      expect(res.statusCode)  .to.be.equal 400
      expect(body)            .to.be.equal 'Bad request'
      done()




    queue = [

      (next) ->
        # expecting username that has less then minimum character length to return 400
        validateUsernameRequestParams = generateValidateUsernameRequestParams
          body       :
