Allow network, genus, taxon, species lookups to expect uppercase values

(closes #3377)

In most cases we prefer taginfo value results with lowercase letters.
A few OSM keys expect values to contain uppercase values
This is not an exhaustive list (e.g. `name` also has uppercase values)
but these are the fields where taginfo value lookup is most useful.
This commit is contained in:
Bryan Housel
2016-10-09 15:48:23 -04:00
parent 1c3e778baf
commit c4724d7ae7
2 changed files with 43 additions and 1 deletions
+36
View File
@@ -195,6 +195,42 @@ describe('iD.serviceTaginfo', function() {
{'value':'US:MD','title':'State highways in the U.S. state of Maryland.'}
]);
});
it('includes biological genus values with capital letters', function() {
var callback = sinon.spy();
taginfo.values({key: 'genus', query: 'qu'}, callback);
server.respondWith('GET', new RegExp('https://taginfo.openstreetmap.org/api/4/key/values'),
[200, { 'Content-Type': 'application/json' },
'{"data":[{"value":"Quercus","description":"Oak", "fraction":0.5}]}']);
server.respond();
expect(callback).to.have.been.calledWith(null, [{'value':'Quercus','title':'Oak'}]);
});
it('includes biological taxon values with capital letters', function() {
var callback = sinon.spy();
taginfo.values({key: 'taxon', query: 'qu'}, callback);
server.respondWith('GET', new RegExp('https://taginfo.openstreetmap.org/api/4/key/values'),
[200, { 'Content-Type': 'application/json' },
'{"data":[{"value":"Quercus robur","description":"Oak", "fraction":0.5}]}']);
server.respond();
expect(callback).to.have.been.calledWith(null, [{'value':'Quercus robur','title':'Oak'}]);
});
it('includes biological species values with capital letters', function() {
var callback = sinon.spy();
taginfo.values({key: 'species', query: 'qu'}, callback);
server.respondWith('GET', new RegExp('https://taginfo.openstreetmap.org/api/4/key/values'),
[200, { 'Content-Type': 'application/json' },
'{"data":[{"value":"Quercus robur","description":"Oak", "fraction":0.5}]}']);
server.respond();
expect(callback).to.have.been.calledWith(null, [{'value':'Quercus robur','title':'Oak'}]);
});
});
describe('#roles', function() {