2 Feature: Update of postcode
3 Tests for updating of data related to postcodes
5 Scenario: A new postcode appears in the postcode and word table
7 | osm | class | type | addr+postcode | addr+housenumber | geometry |
8 | N34 | place | house | 01982 | 111 |country:de |
10 Then location_postcode contains exactly
11 | country | postcode | geometry |
12 | de | 01982 | country:de |
14 | osm | class | type | addr+postcode | addr+housenumber | geometry |
15 | N35 | place | house | 4567 | 5 |country:ch |
16 And updating postcodes
17 Then location_postcode contains exactly
18 | country | postcode | geometry |
19 | de | 01982 | country:de |
20 | ch | 4567 | country:ch |
21 And there are word tokens for postcodes 01982,4567
23 Scenario: When the last postcode is deleted, it is deleted from postcode and word
25 | osm | class | type | addr+postcode | addr+housenumber | geometry |
26 | N34 | place | house | 01982 | 111 |country:de |
27 | N35 | place | house | 4567 | 5 |country:ch |
29 And marking for delete N34
30 And updating postcodes
31 Then location_postcode contains exactly
32 | country | postcode | geometry |
33 | ch | 4567 | country:ch |
34 And there are word tokens for postcodes 4567
35 And there are no word tokens for postcodes 01982
37 Scenario: A postcode is not deleted from postcode and word when it exist in another country
39 | osm | class | type | addr+postcode | addr+housenumber | geometry |
40 | N34 | place | house | 01982 | 111 |country:de |
41 | N35 | place | house | 01982 | 5 |country:fr |
43 And marking for delete N34
44 And updating postcodes
45 Then location_postcode contains exactly
46 | country | postcode | geometry |
47 | fr | 01982 | country:fr |
48 And there are word tokens for postcodes 01982
50 Scenario: Updating a postcode is reflected in postcode table
52 | osm | class | type | addr+postcode | geometry |
53 | N34 | place | postcode | 01982 | country:de |
56 | osm | class | type | addr+postcode | geometry |
57 | N34 | place | postcode | 20453 | country:de |
58 And updating postcodes
59 Then location_postcode contains exactly
60 | country | postcode | geometry |
61 | de | 20453 | country:de |
62 And there are word tokens for postcodes 20453
64 Scenario: When changing from a postcode type, the entry appears in placex
67 | osm | class | type | addr+postcode | geometry |
68 | N34 | place | postcode | 01982 | country:de |
69 Then placex has no entry for N34
71 | osm | class | type | addr+postcode | housenr | geometry |
72 | N34 | place | house | 20453 | 1 | country:de |
74 | object | addr+housenumber | geometry |
75 | N34 | 1 | country:de|
76 And place contains exactly
77 | object | class | type |
78 | N34 | place | house |
79 When updating postcodes
80 Then location_postcode contains exactly
81 | country | postcode | geometry |
82 | de | 20453 | country:de |
83 And there are word tokens for postcodes 20453
85 Scenario: When changing to a postcode type, the entry disappears from placex
88 | osm | class | type | addr+postcode | housenr | geometry |
89 | N34 | place | house | 20453 | 1 | country:de |
91 | object | addr+housenumber | geometry |
92 | N34 | 1 | country:de|
94 | osm | class | type | addr+postcode | geometry |
95 | N34 | place | postcode | 01982 | country:de |
96 Then placex has no entry for N34
97 And place contains exactly
98 | object | class | type |
99 | N34 | place | postcode |
100 When updating postcodes
101 Then location_postcode contains exactly
102 | country | postcode | geometry |
103 | de | 01982 | country:de |
104 And there are word tokens for postcodes 01982
106 Scenario: When a parent is deleted, the postcode gets a new parent
107 Given the grid with origin DE
112 | osm | class | type | name | admin | geometry |
113 | R1 | boundary | administrative | Big | 6 | (1,4,6,2,1) |
114 | R2 | boundary | administrative | Small | 6 | (1,3,5,2,1) |
115 Given the named places
116 | osm | class | type | addr+postcode | geometry |
117 | N9 | place | postcode | 12345 | 9 |
119 And updating postcodes
120 Then location_postcode contains exactly
121 | country | postcode | geometry | parent_place_id |
122 | de | 12345 | 9 | R2 |
123 When marking for delete R2
124 Then location_postcode contains exactly
125 | country | postcode | geometry | parent_place_id |
126 | de | 12345 | 9 | R1 |