 
     # Overwrite the settings in db
     props.icon = 'icon-test'
-    db.add props, () ->
+    db.add(props)
+
+    project.onUpdate () ->
       expect(project.updateProps).toHaveBeenCalled()
       expect(project.props.icon).toBe 'icon-test'
 


        project.save()

        expect(db.add).not.toHaveBeenCalled()
        expect(db.update).toHaveBeenCalled()

        title: 'updateProjectIfIDIsSet',
        paths: ['/Test/']

      spyOn(db, 'update').andCallThrough()

      db.add props, (id) ->
