From: Sarah Hoffmann Date: Thu, 24 Feb 2022 15:18:49 +0000 (+0100) Subject: add tests for country updates X-Git-Tag: v4.1.0~76^2~1 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/1d82569f6d22c4d43303cedb50cfe361277dd99b add tests for country updates --- diff --git a/test/bdd/db/update/country.feature b/test/bdd/db/update/country.feature new file mode 100644 index 00000000..2085e4e5 --- /dev/null +++ b/test/bdd/db/update/country.feature @@ -0,0 +1,96 @@ +@DB +Feature: Country handling + Tests for update of country information + + @fail-legacy + Scenario: When country names are changed old ones are no longer searchable + Given the places + | osm | class | type | admin | name+name:xy | country | geometry | + | R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) | + Given the places + | osm | class | type | name | geometry | + | N1 | place | town | Wenig | country:de | + When importing + When sending search query "Wenig, Loudou" + Then results contain + | osm | + | N1 | + When updating places + | osm | class | type | admin | name+name:xy | country | geometry | + | R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) | + When sending search query "Wenig, Loudou" + Then exactly 0 results are returned + + @fail-legacy + Scenario: When country names are deleted they are no longer searchable + Given the places + | osm | class | type | admin | name+name:xy | country | geometry | + | R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) | + Given the places + | osm | class | type | name | geometry | + | N1 | place | town | Wenig | country:de | + When importing + When sending search query "Wenig, Loudou" + Then results contain + | osm | + | N1 | + When updating places + | osm | class | type | admin | name+name:en | country | geometry | + | R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) | + When sending search query "Wenig, Loudou" + Then exactly 0 results are returned + When sending search query "Wenig" + | accept-language | + | xy,en | + Then results contain + | osm | display_name | + | N1 | Wenig, Germany | + + + Scenario: Default country names are always searchable + Given the places + | osm | class | type | name | geometry | + | N1 | place | town | Wenig | country:de | + When importing + When sending search query "Wenig, Germany" + Then results contain + | osm | + | N1 | + When updating places + | osm | class | type | admin | name+name:en | country | geometry | + | R1 | boundary | administrative | 2 | Lilly | de | (9 52, 9 53, 10 52, 9 52) | + When sending search query "Wenig, Germany" + | accept-language | + | en,de | + Then results contain + | osm | display_name | + | N1 | Wenig, Lilly | + + + @fail-legacy + Scenario: When a localised name is deleted, the standard name takes over + Given the places + | osm | class | type | admin | name+name:de | country | geometry | + | R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) | + Given the places + | osm | class | type | name | geometry | + | N1 | place | town | Wenig | country:de | + When importing + When sending search query "Wenig, Loudou" + | accept-language | + | de,en | + Then results contain + | osm | display_name | + | N1 | Wenig, Loudou | + When updating places + | osm | class | type | admin | name+name:en | country | geometry | + | R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) | + When sending search query "Wenig, Loudou" + Then exactly 0 results are returned + When sending search query "Wenig" + | accept-language | + | de,en | + Then results contain + | osm | display_name | + | N1 | Wenig, Deutschland | +