 
   describe '.mount', ->
 
-    it 'mounts component on real dom', ->
+    it 'mounts component on real dom and tracks updates', ->
 
-      assert.equal document.querySelectorAll('.todo-title').length, 2
+      getTodosFromDOM = -> _.pluck(document.querySelectorAll('.todo-title'), 'innerText')
 
-      app.todos.push {title: 'hoge'}
+      assert.deepEqual getTodosFromDOM(), ['Go to town', 'Buy some food']
+
+      app.todos = todos2
       app.update()
 
-      assert.equal document.querySelectorAll('.todo-title').length, 3
+      assert.deepEqual getTodosFromDOM(), ['foo', 'bar', 'baz']
+
+      app.todos = todos
+      app.update()
+
+      assert.deepEqual getTodosFromDOM(), ['Go to town', 'Buy some food']

assert = (require 'chai').assert
Mount = require '../src/Mount'
{Todo, TodoList, NewTodo, TodoApp} = require './fixtures/components'

todos = [
  { title: 'Go to town' }
  { title: 'Buy some food' }
]

todos2 = [
  { title: 'foo' }
  { title: 'bar' }
  { title: 'baz' }
]

describe 'Mount', ->
