Default wildcard tags to "yes"

Fixes #1715
This commit is contained in:
John Firebaugh
2013-08-22 14:30:27 -07:00
parent c7363623ad
commit 6cdd928ea3
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -75,7 +75,11 @@ iD.presets.Preset = function(id, preset, fields) {
tags = _.clone(tags);
for (var k in applyTags) {
if (applyTags[k] !== '*') tags[k] = applyTags[k];
if (applyTags[k] === '*') {
tags[k] = 'yes';
} else {
tags[k] = applyTags[k];
}
}
for (var f in preset.fields) {
+2 -2
View File
@@ -64,9 +64,9 @@ describe('iD.presets.Preset', function() {
expect(preset.applyTags({}, 'area')).to.eql({highway: 'residential'});
});
it("does not add wildcard tags", function() {
it("adds wildcard tags with value 'yes'", function() {
var preset = iD.presets.Preset('test', {tags: {building: '*'}});
expect(preset.applyTags({}, 'area')).to.eql({});
expect(preset.applyTags({}, 'area')).to.eql({building: 'yes'});
});
it("adds default tags of fields with matching geometry", function() {