|
|
|
@ -186,6 +186,42 @@ module.exports.tests.trump = function(test, common) {
|
|
|
|
|
t.end(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('openaddresses with zip trumps openaddresses without zip', function (t) { |
|
|
|
|
var req = { |
|
|
|
|
clean: { |
|
|
|
|
text: '100 Main St', |
|
|
|
|
size: 100 |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
var res = { |
|
|
|
|
data: [ |
|
|
|
|
{ |
|
|
|
|
'name': { 'default': '100 Main St' }, |
|
|
|
|
'source': 'openaddresses', |
|
|
|
|
'source_id': '123456', |
|
|
|
|
'layer': 'address', |
|
|
|
|
'address_parts': {} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'name': { 'default': '100 Main St' }, |
|
|
|
|
'source': 'openaddresses', |
|
|
|
|
'source_id': '654321', |
|
|
|
|
'layer': 'address', |
|
|
|
|
'address_parts': { |
|
|
|
|
'zip': '54321' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var expectedCount = 1; |
|
|
|
|
dedupe(req, res, function () { |
|
|
|
|
t.equal(res.data.length, expectedCount, 'results have fewer items than before'); |
|
|
|
|
t.deepEqual(res.data[0].source_id, '654321', 'openaddresses result with zip won'); |
|
|
|
|
t.end(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
module.exports.all = function (tape, common) { |
|
|
|
|