 
   it 'should send HTTP 400 if user is non-existent', (done) ->
 
-    withConvertedUserAndApiToken ({ userFormData, apiToken }) ->
+    options = { createGroup : yes, groupData : { isApiTokenEnabled : yes } }
+    withConvertedUserAndApiToken options, ({ userFormData, apiToken }) ->
 
       createSsoTokenRequestParams = generateCreateSsoTokenRequestParams
         headers : { Authorization : "Bearer #{apiToken.code}" }

  it 'should send HTTP 400 if user is not a member of the api token group', (done) ->

    # creating user, group, and api token
    options = { createGroup : yes }
    withConvertedUserAndApiToken options, ({ userFormData, apiToken }) ->

      # creating another user, which is not a member of the previously created group

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

