   objects = new Batman.Set()
 
   helpers.render source, {objects}, (node, view) ->
-    names = $('p', view.get('node')).map -> @innerHTML
-    names = names.toArray()
-    deepEqual names, []
+    deepEqual getPs(view), []
     QUnit.start()
 
 asyncTest 'it should allow loops over undefined values', 3, ->

  objects = new Batman.Set('foo', 'bar', 'baz')

  helpers.render source, {objects}, (node, view) ->
    names = $('p', view.get('node')).map -> @innerHTML
    names = names.toArray()
    deepEqual names, ['foo', 'bar', 'baz']
    QUnit.start()

asyncTest 'it should allow loops over empty collections', 1, ->

  objects1 = new Batman.Set('foo', 'bar', 'baz')
  objects2 = new Batman.Set('a', 'b', 'c')

  helpers.render source, false, {objects1, objects2}, (node, view) ->
    deepEqual getPs(view), ['foo', 'bar', 'baz', 'a', 'b', 'c']
    QUnit.start()

asyncTest 'it should render consecutive loops bound to the same collection', 4, ->
  source = '<p data-foreach-object="objects" data-bind="object"></p><p data-foreach-object="objects" data-bind="object"></p>'
  objects = new Batman.Set('foo', 'bar', 'baz')

  helpers.render source, false, {objects}, (node, view) ->
    deepEqual getPs(view), ['foo', 'bar', 'baz', 'foo', 'bar', 'baz']
    objects.remove 'foo'
    delay ->
      deepEqual getPs(view), ['bar', 'baz', 'bar', 'baz']
      objects.remove 'bar'
      delay ->
        deepEqual getPs(view), ['baz', 'baz']
        objects.remove 'baz'
        delay ->
          equal $('p', node).length, 0
