From 23f435759e3db6ee0cdc5d148fd0e76eede04734 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 30 Nov 2012 07:14:15 -0800 Subject: [PATCH 1/3] Fix specs --- test/spec/Graph.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/spec/Graph.js b/test/spec/Graph.js index ec4fe45af..d95349cc9 100644 --- a/test/spec/Graph.js +++ b/test/spec/Graph.js @@ -56,19 +56,19 @@ describe('Graph', function() { describe("#modifications", function () { it("filters entities by modified", function () { - var a = {modified: function () { return true; }}, - b = {modified: function () { return false; }}, + var a = {id: 'a', modified: function () { return true; }}, + b = {id: 'b', modified: function () { return false; }}, graph = iD.Graph({ 'a': a, 'b': b }); - expect(graph.modifications()).toEqual([iD.Entity(graph.entity('a'))]); + expect(graph.modifications()).toEqual([graph.fetch('a')]); }); }); describe("#creations", function () { it("filters entities by created", function () { - var a = {created: function () { return true; }}, - b = {created: function () { return false; }}, - graph = iD.Graph([a, b]); - expect(graph.creations()).toEqual([a]); + var a = {id: 'a', created: function () { return true; }}, + b = {id: 'b', created: function () { return false; }}, + graph = iD.Graph({ 'a': a, 'b': b }); + expect(graph.creations()).toEqual([graph.fetch('a')]); }); }); }); From f06ae6b70ed046f2ed9402608a809863ee0945a6 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 30 Nov 2012 07:17:32 -0800 Subject: [PATCH 2/3] Eliminate temporary --- js/id/graph/graph.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/id/graph/graph.js b/js/id/graph/graph.js index 992c1d7fe..41000fd11 100644 --- a/js/id/graph/graph.js +++ b/js/id/graph/graph.js @@ -32,8 +32,7 @@ iD.Graph.prototype = { replace: function(entity, annotation) { var entities = _.clone(this.entities); entities[entity.id] = entity; - var g = iD.Graph(entities, annotation); - return g; + return iD.Graph(entities, annotation); }, remove: function(entity, annotation) { From 852720bc85ff4df4b6ac13db1e6f731c7cba0254 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 30 Nov 2012 07:21:29 -0800 Subject: [PATCH 3/3] Fix spec --- test/spec/Inspector.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/spec/Inspector.js b/test/spec/Inspector.js index a12a51ca6..252107f23 100644 --- a/test/spec/Inspector.js +++ b/test/spec/Inspector.js @@ -23,13 +23,13 @@ describe("Inspector", function () { expect(spy).toHaveBeenCalledWith(entity); }); - it("emits a change event when the save button is clicked", function () { + it("emits a changeTags event when the save button is clicked", function () { var spy = jasmine.createSpy(); - inspector.on('change', spy); + inspector.on('changeTags', spy); happen.click(element.select('.save').node()); - expect(spy).toHaveBeenCalledWith(entity, { '': '' }); + expect(spy).toHaveBeenCalledWith(entity, {}); }); it("emits a remove event when the delete button is clicked", function () {