 
   it 'should send HTTP 401 if no api token provided and session not belongs to an admin', (done) ->
 
-    withConvertedUser ({ group, account, client }) ->
+    { client } = TESTUSERS.regular
 
-      logRequestParams = generateRequestParamsEncodeBody
-        url      : generateUrl { route : '-/api/logs' }
-        clientId : client.sessionToken
+    logRequestParams = generateRequestParamsEncodeBody
+      url      : generateUrl { route : '-/api/logs' }
+      clientId : client.sessionToken
 
-      request.get logRequestParams, (err, res, body) ->
+    request.get logRequestParams, (err, res, body) ->
 
-        expect(err).to.not.exist
-        expect(res.statusCode).to.be.equal 401
-        expect(JSON.parse body).to.be.deep.equal { error : apiErrors.unauthorizedRequest }
+      expect(err).to.not.exist
+      expect(res.statusCode).to.be.equal 401
+      expect(JSON.parse body).to.be.deep.equal { error : apiErrors.unauthorizedRequest }
 
-        done()
+      done()
 
 
   it 'should send HTTP 403 if group.isApiEnabled is not true', (done) ->


  return requestParams

beforeTests = -> before (done) ->

  checkBongoConnectivity done


runTests = -> describe 'server.handlers.api.logs', ->


  it 'should send HTTP 200 if token not provided but there is a valid session', (done) ->

    { client } = TESTUSERS.admin

    logRequestParams = generateRequestParamsEncodeBody
      url      : generateUrl { route : '-/api/logs' }
      clientId : client.sessionToken

    request.get logRequestParams, (err, res, body) ->

      expect(err).to.not.exist
      expect(res.statusCode).to.be.equal 200
      expect(body).to.contain 'data'

      done()


beforeTests()
