 
   it 'should send HTTP 400 if user is non-existent', (done) ->
 
-    withConvertedUserAndApiToken { createGroup : yes }, ({ group }) ->
+    options = { createGroup : yes, groupData : { isApiTokenEnabled : yes } }
+    withConvertedUserAndApiToken options, ({ group }) ->
       token = JUser.createJWT { username: 'non-existent-user', group : group.slug }
       ssoTokenLoginRequestParams = generateSsoTokenLoginRequestParams
         qs  : { token }


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

    withConvertedUserAndApiToken { createGroup : yes }, ({ group, apiToken }) ->

      token    = null
      account  = null


  it 'should send HTTP and be able to login user with valid request', (done) ->

    options = { createGroup : yes, groupData : { isApiTokenEnabled : yes } }
    withConvertedUserAndApiToken options, ({ group, apiToken }) ->
      createUserAndSsoToken apiToken.code, ({ token }) ->

        ssoTokenLoginRequestParams = generateSsoTokenLoginRequestParams
