 
   it 'should send HTTP 400 when company is not set', (done) ->
 
-    createTeamRequestParams = generateCreateTeamRequestParams
-      body          :
-        companyName : ''
-
-    request.post createTeamRequestParams, (err, res, body) ->
-      expect(err)             .to.not.exist
-      expect(res.statusCode)  .to.be.equal 400
-      expect(body)            .to.be.equal 'Company name can not be empty.'
-      done()
+    generateCreateTeamRequestParams {
+      body : { companyName : '' }
+    }, (createTeamRequestParams) ->
+
+      request.post createTeamRequestParams, (err, res, body) ->
+        expect(err)             .to.not.exist
+        expect(res.statusCode)  .to.be.equal 400
+        expect(body)            .to.be.equal 'Company name can not be empty.'
+        done()
 
 
   it 'should send HTTP 400 when slug is not set', (done) ->
 
-    createTeamRequestParams = generateCreateTeamRequestParams
-      body   :
-        slug : ''
-
-    request.post createTeamRequestParams, (err, res, body) ->
-      expect(err)             .to.not.exist
-      expect(res.statusCode)  .to.be.equal 400
-      expect(body)            .to.be.equal 'Group slug can not be empty.'
-      done()
+    generateCreateTeamRequestParams {
+      body : { slug : '' }
+    }, (createTeamRequestParams) ->
+
+      request.post createTeamRequestParams, (err, res, body) ->
+        expect(err)             .to.not.exist
+        expect(res.statusCode)  .to.be.equal 400
+        expect(body)            .to.be.equal 'Group slug can not be empty.'
+        done()
 
 
   it 'should send HTTP 400 when slug is invalid or a reserved one', (done) ->


  it 'should send HTTP 200 when invitees is not set', (done) ->

    createTeamRequestParams = generateCreateTeamRequestParams
      body       :
        invitees : ''

    request.post createTeamRequestParams, (err, res, body) ->
      expect(err)             .to.not.exist
      expect(res.statusCode)  .to.be.equal 200
      done()


  it 'should save emailFrequency.marketing according to newsletter param', (done) ->

    makeCreateTeamRequest = (username, newsletter) ->
      createTeamRequestParams = generateCreateTeamRequestParams
        body         :
          username   : username
          newsletter : newsletter

      request.post createTeamRequestParams, (err, res, body) ->
        expect(err)             .to.not.exist
        expect(res.statusCode)  .to.be.equal 200
        queue.next()

    username = ''


        password        : password
        passwordConfirm : password

    queue = [

      ->
