 
   testClientBasicForeach: @basic 'users-posts-foreach'
 
+  testClientBasicAutorun: @basic 'users-posts-autorun'
+
   @unsubscribing: (publishName) -> [
     ->
       @userId = Random.id()

  testClientRemoveField: @removeField 'users-posts'

  testClientRemoveFieldForeach: @removeField 'users-posts-foreach'

  @multiple: (publishName) -> [
    ->

        fields:
          posts: 1

      projectedField = Fields.findOne userId

      Posts.find(
        _id:
          $in: user?.posts or []
      ,
        fields: _.omit (projectedField or {}), '_id'
      ).forEach (document, i, cursor) =>
        fields = _.omit document, '_id'
        fields.dummyField = true
        @added 'Posts_meteor_reactivepublish_tests', document._id, fields

      @ready()

    @onStop =>
      handle?.stop()
      handle = null

    return

  Meteor.publish 'users-posts-autorun', (userId) ->
    handle = Tracker.autorun (computation) =>
      user = Users.findOne userId,
        fields:
          posts: 1

      projectedField = Fields.findOne userId

      Tracker.autorun (computation) =>
        Posts.find(
          _id:
            $in: user?.posts or []
        ,
          fields: _.omit (projectedField or {}), '_id'
        ).forEach (document, i, cursor) =>
          fields = _.omit document, '_id'
          fields.dummyField = true
          @added 'Posts_meteor_reactivepublish_tests', document._id, fields

      @ready()

