         expect(oldRoot.hasParent()).toBeFalsy()
 
   describe "serialization", ->
-    newTreeView = null
+    [newRootView, newTreeView] = []
 
     afterEach ->
-      newTreeView.deactivate()
+      newRootView.deactivate()
+
   describe "when the prototypes deactivate method is called", ->
     it "calls the deactivate on tree view instance", ->
       spyOn(treeView, "deactivate").andCallThrough()

      expect(treeView).toMatchSelector ':focus'

      newRootView = RootView.deserialize(rootView.serialize())
      rootView.remove()
      newRootView.attachToDom()
      newRootView.activateExtension(TreeView)

      newTreeView = newRootView.find(".tree-view").view()
      expect(newTreeView).toMatchSelector ':focus'
      newRootView.remove()

  describe "when tree-view:toggle is triggered on the root view", ->
    beforeEach ->


    describe "when the project has no path", ->
      beforeEach ->
        rootView.deactivate()

        rootView = new RootView
        rootView.activateExtension(TreeView)
