       query = KodingLogger
         .generateRestrictedQuery group, (logs.join ' OR '), scope
 
+      identifier = KodingLogger.getIdentifier scope, group
+
       KodingLogger.connect()
 
       KodingLogger.pt.on 'connect', ->

      restrictedQuery = KodingLogger
        .generateRestrictedQuery group, query, scope

      expect restrictedQuery
        .to.exist
        .to.be.equal "[#{scope}:#{group}]"

      done()



      restrictedQuery = KodingLogger.generateRestrictedQuery group, query

      identifiers = []
      for _scope in KodingLogger.SCOPES
        identifiers.push KodingLogger.getIdentifier _scope, group

      expect restrictedQuery
        .to.exist
        .to.be.equal "(#{identifiers.join ' OR '}) AND #{query}"

      done()

