Merge branch 'master' of github.com:systemed/iD

This commit is contained in:
Tom MacWright
2012-11-30 15:57:21 -05:00
3 changed files with 11 additions and 12 deletions
+1 -2
View File
@@ -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) {
+7 -7
View File
@@ -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')]);
});
});
});
+3 -3
View File
@@ -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 () {