           queue.next()
 
       ->
-        # expecting HTTP 400 using already registered username
-        expectedBody = 'Errors were encountered during validation: username'
+        # expecting HTTP 400 from juser.convert
+        expectedBody = 'Email is already in use!'
         request.post createTeamRequestParams, (err, res, body) ->
           expect(err)             .to.not.exist
           expect(res.statusCode)  .to.be.equal 400

      body   :
        slug : 'koding'

    expectedBody = 'Sorry, Team URL \'koding.koding.com\' is already in use'
    request.post createTeamRequestParams, (err, res, body) ->
      expect(err)             .to.not.exist
      expect(res.statusCode)  .to.be.equal 403

    daisy queue


  it 'should send HTTP 400 when user is unregistered but alreadyMember set to true', (done) ->

    createTeamRequestParams = generateCreateTeamRequestParams
      body            :
        alreadyMember : 'true'

    # expecting user to create team when alreadyMember has wrong value
    request.post createTeamRequestParams, (err, res, body) ->
      expect(err)             .to.not.exist
      expect(res.statusCode)  .to.be.equal 400
      expect(body)            .to.be.equal 'Unknown user name'
      done()


  # TODO: this somehow returns 200, needs to be investigated
  it.skip 'should send HTTP 400 when email is not valid', (done) ->

