Exclude presets with searchable: false from search (fixes #932)

This commit is contained in:
John Firebaugh
2013-03-17 20:59:11 -07:00
parent 13cd85a362
commit 7912b33b4c
2 changed files with 18 additions and 5 deletions
+10 -1
View File
@@ -54,6 +54,15 @@ describe("iD.presets.Collection", function() {
it("always includes other", function() {
expect(c.search("blade of grass").collection.indexOf(p.other) >= 0).to.eql(true);
});
});
it("excludes presets with searchable: false", function() {
var excluded = iD.presets.Preset('excluded', {
tags: {},
geometry: [],
searchable: false
}),
collection = iD.presets.Collection([excluded, p.other]);
expect(collection.search("excluded").collection).not.to.include(excluded);
});
});
});