 
 describe 'QueueWorker', ->
   beforeEach ->
+    mongoHost = process.env.MONGODB_HOST ? 'localhost'
+    mongoPort = process.env.MONGODB_PORT ? '27017'
+    @databaseUri = "#{mongoHost}:#{mongoPort}/meshblu-core-test"
+
     @clientId = uuid.v1()
     @cacheClientId = uuid.v1()
     @client = _.bindAll redis.createClient @clientId

    @datastoreFactory =
      build: (collection) =>
        new Datastore
          database: 'meshblu-core-test'
          collection: collection

    @cacheFactory =

    describe 'when called with an CheckToken job', ->
      beforeEach (done) ->
        datastore = new Datastore
          database: @databaseUri
          collection: 'devices'

        record =
