     candidate = "#{username}@#{host}"
 
     validateEmailRequestParams = generateValidateEmailRequestParams
-      body     :
-        email  : candidate
+      body    :
+        email : candidate
 
     # expecting email validation to fail using already registered email
     request.post validateEmailRequestParams, (err, res, body) ->
-      expect(err)             .to.not.exist
-      expect(res.statusCode)  .to.be.equal 400
-      expect(body)            .to.be.equal 'Bad request'
+      expect(err).to.not.exist
+      expect(res.statusCode).to.be.equal 400
+      expect(body).to.be.equal 'Bad request'
       done()
 
 
   it 'should send HTTP 400 if email is in use and password is invalid', (done) ->
 
-    email     = generateRandomEmail()
-    username  = generateRandomUsername()
-    password  = 'testpass'
+    email    = generateRandomEmail()
+    username = generateRandomUsername()
+    password = 'testpass'
 
     registerRequestParams = generateRegisterRequestParams
       body              :


    queue = [

      ->
        # registering new user
        request.post registerRequestParams, (err, res, body) ->
          expect(err)             .to.not.exist
          expect(res.statusCode)  .to.be.equal 200
          queue.next()

      ->
        # expecting email with invalid password to fail
        request.post validateEmailRequestParams, (err, res, body) ->
          expect(err)             .to.not.exist
          expect(res.statusCode)  .to.be.equal 200
          expect(body)            .to.be.equal 'User is logged in!'
          queue.next()

      -> done()

    ]

    daisy queue


  it 'should send HTTP 200 if email is valid and not in use', (done) ->

    cookieJar                  = request.jar()

    validateEmailRequestParams = generateValidateEmailRequestParams
      jar     : cookieJar
      body    :
        email : generateRandomEmail()

    url                        = validateEmailRequestParams.url

    request.post validateEmailRequestParams, (err, res, body) ->
      expect(err)                           .to.not.exist
      expect(res.statusCode)                .to.be.equal 200
      # expecting clientId cookie to be set
      expect(cookieJar.getCookieString url) .to.contain 'clientId'
      expect(body)                          .to.be.equal 'true'
      done()


runTests()

    validateEmailRequestParams.body = null

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


