Skip to content

Commit

Permalink
Merge 827d1db into 9bfc4d7
Browse files Browse the repository at this point in the history
  • Loading branch information
kiliankoe committed Feb 26, 2017
2 parents 9bfc4d7 + 827d1db commit 09f3433
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
4 changes: 2 additions & 2 deletions lib/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ function pointFinder(name) {

return data.Points.map(function (p) {
return p.split('|');
}).filter(function (p) {
return p[3] && (p[2].length === 0 || p[2] === 'Dresden');
}).map(function (p) {
var city = p[2] === "" ? "Dresden" : p[2]
return {
stop: p[3],
id: p[0],
city: city,
coords: utils.GK4toWGS84(p[4], p[5])
};
});
Expand Down
1 change: 0 additions & 1 deletion test/data/find-empty_json.json

This file was deleted.

19 changes: 1 addition & 18 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,9 @@ describe('dvb.find', function () {
function assertStop(stop) {
assert(stop.stop);
assert(stop.id);
assert(stop.city);
assert(Array.isArray(stop.coords));
assert.strictEqual(2, stop.coords.length);
assert.strictEqual(51, Math.floor(stop.coords[0]));
assert.strictEqual(13, Math.floor(stop.coords[1]));
}

it('should return an array', function (done) {
Expand Down Expand Up @@ -286,22 +285,6 @@ describe('dvb.find', function () {
}).then(assert);
});
});

describe('dvb.find "0"', function () {
mockRequest('find-empty_json.json');

it('should return an empty array', function (done) {
dvb.find('0')
.then(function (data) {
assert(Array.isArray(data));
assert.equal(data.length, 0);
done();
})
.catch(function (err) {
done(err);
});
});
})
});

describe('dvb.pins', function () {
Expand Down

0 comments on commit 09f3433

Please sign in to comment.