     it 'should be able to remove machine with valid request', (done) ->
 
       options = { provider : 'managed' }
-      withConvertedUserAnd ['Machine'], options, ({ client, account, user, machine }) ->
-
-        queue = [
-
-          ->
-            fetchGroup client, (group) ->
-              client.r = { account, user, group }
-              queue.next()
+      withConvertedUserAnd ['Machine'], options, (data) ->
+        { client, account, user, machine, group } = data
+        client.r = { account, user, group }
+
+        queue = [
 
           ->
             Managed.remove client, { machineId : machine._id.toString() }, (err) ->

{ _
  daisy
  expect
  fetchGroup
  withConvertedUser
  generateRandomString
  checkBongoConnectivity } = require '../../../../testhelper'


    it 'should fail when required options not provided', (done) ->

      withConvertedUser ({ client, account, user, group }) ->
        client.r      = { account, user, group }
        expectedError = 'A valid machineId and an update option is required.'

        Managed.update client, {}, (err) ->
          expect(err?.message).to.be.equal expectedError
          done()


    it 'should fail if provided some options are not valid', (done) ->

      withConvertedUser ({ client, account, user, group }) ->

        generateDefaultOptions = (options) ->

