       onError: @expect =>
         @assertTrue true
 
+  testClientLocalCollection: [
+    ->
+      Meteor.call 'setLocalCollectionLimit', 10, @expect (error) =>
+          @assertFalse error, error
+  ,
+    ->
+      @assertSubscribeSuccessful 'localCollection', @expect()
+  ,
+    ->
+      @assertEqual LocalCollection.find({}).fetch(), []
+
+      for i in [0...10]
+        Meteor.call 'insertLocalCollection', {i: i}, @expect (error, documentId) =>
+          @assertFalse error, error
+          @assertTrue documentId
+  ,
+    ->
+      # To wait a bit for change to propagate.
+      Meteor.setTimeout @expect(), 100 # ms
+  ,
+    ->
+      @assertEqual LocalCollection.find({}).count(), 10
+
+      Meteor.call 'setLocalCollectionLimit', 5, @expect (error) =>
+        @assertFalse error, error
+
+      # To wait a bit for change to propagate.
+      Meteor.setTimeout @expect(), 100 # ms
+  ,
+    ->
+      @assertEqual LocalCollection.find({}).count(), 5
+
+      for i in [0...10]
+        Meteor.call 'insertLocalCollection', {i: i}, @expect (error, documentId) =>
+          @assertFalse error, error
+          @assertTrue documentId
+  ,
+    ->
+      # To wait a bit for change to propagate.
+      Meteor.setTimeout @expect(), 100 # ms
+  ,
+    ->
+      @assertEqual LocalCollection.find({}).count(), 5
+
+      Meteor.call 'setLocalCollectionLimit', 15, @expect (error) =>
+        @assertFalse error, error
+
+      # To wait a bit for change to propagate.
+      Meteor.setTimeout @expect(), 100 # ms
+  ,
+    ->
+      @assertEqual LocalCollection.find({}).count(), 15
+  ]
+
 # Register the test case.
 ClassyTestCase.addTest new ReactivePublishTestCase()

      projectedField = Fields.findOne userId

      {user, projectedField}

class ReactivePublishTestCase extends ClassyTestCase
  @testName: 'reactivepublish'

Fields = new Mongo.Collection 'Fields_meteor_reactivepublish_tests'

if Meteor.isServer
  LocalCollection = new Mongo.Collection null

  localCollectionLimit = new ReactiveVar null

  Meteor.publish null, ->
    Users.find()

