       @graphStore.addNode @nodeB
       @graphStore.addLink @link
 
-    describe "The serialize function", ->
+    describe "The toJsonString function", ->
       it "should serialize all the properties of the model", ->
-        model = @graphStore.serialize()
+        jsonString = @graphStore.toJsonString()
+        model = JSON.parse jsonString
 
         model.version.should.exist
         model.nodes.should.exist

        link.relation.text.should.equal "increases"
        link.relation.formula.should.equal "1 * in"

    describe "the toJsonString function", ->
      it "should create a string nodes and links", ->
        jsonString = @graphStore.toJsonString()
        jsonString.should.match(/"nodes":/)
        jsonString.should.match(/"links":/)
        jsonString.should.not.match(/"description":/)
        jsonString.should.not.match(/"metadata":/)
        @graphStore.toJsonString(@fakePalette).should.match(/"palette":/)

  describe "loadData", ->
    beforeEach ->

        model.links.length.should.equal 1

      it "should correctly serialize a node", ->
        jsonString = @graphStore.toJsonString()
        node = JSON.parse(jsonString).nodes[0]
        node.key.should.equal "a"
        node.data.title.should.equal "a"
        node.data.x.should.equal 10
