   helpers.render source, {objects}, (node, view) ->
     objects.remove('foo')
     delay =>
-      names = $('p', view.get('node')).map -> @innerHTML
-      names = names.toArray()
-      deepEqual names, ['bar']
+      deepEqual getPs(view), ['bar']
 
 asyncTest 'it should atomically reorder DOM nodes when the set is reordered', ->
   source = '<div><p data-foreach-object="objects.sortedBy[currentSort]" class="present" data-bind="object.name"></p></div>'

  source = '<p data-foreach-object="objects" data-bind="object"></p><p data-foreach-object="objects" data-bind="object"></p>'
  objects = new Batman.Set()

  helpers.render source, false, {objects}, (node) ->
    equal $('p', node).length, 0
    objects.add 'foo', 'bar', 'baz'
    delay ->
      names = $('p', node).map(-> @innerHTML).toArray()
      deepEqual names, ['foo', 'bar', 'baz', 'foo', 'bar', 'baz']
      objects.remove 'bar'
      delay ->
        names = $('p', node).map(-> @innerHTML).toArray()
        deepEqual names, ['foo', 'baz', 'foo', 'baz']

asyncTest 'it should update the whole set of nodes if the collection changes', ->
  source = '<p data-foreach-object="objects" class="present" data-bind="object"></p>'

  helpers.render source, {objects}, (node, view) ->
    objects.add({id: 0, name: 'zero'})
    delay =>
      deepEqual getPs(view), ['zero', 'foo', 'bar']

asyncTest 'the ready event should wait for all children to be rendered', ->
  source = '<p data-foreach-object="objects" class="present" data-bind="object"></p>'
