1 Feature: Update of postcode
2 Tests for updating of data related to postcodes
4 Scenario: Updating postcode in postcode boundaries without ref
5 Given the grid with origin FR
10 | osm | postcode | centroid | geometry |
11 | R1 | 12345 | 9 | (1,2,3,4,1) |
14 Then result 0 contains
18 | osm | postcode | centroid | geometry |
19 | R1 | 54321 | 9 | (1,2,3,4,1) |
20 When refreshing postcodes
22 Then exactly 0 results are returned
23 When geocoding "54321"
24 Then result 0 contains
28 Scenario: A new postcode appears in the postcode table
30 | osm | class | type | addr+postcode | addr+housenumber | geometry |
31 | N34 | place | house | 01982 | 111 | country:de |
33 Then location_postcodes contains exactly
34 | country_code | postcode | centroid!wkt |
35 | de | 01982 | country:de |
37 | osm | postcode | centroid |
38 | N66 | 99201 | country:fr |
40 | osm | class | type | addr+postcode | addr+housenumber | geometry |
41 | N35 | place | house | 4567 | 5 | country:ch |
42 And refreshing postcodes
43 Then location_postcodes contains exactly
44 | country_code | postcode | centroid!wkt |
45 | de | 01982 | country:de |
46 | ch | 4567 | country:ch |
47 | fr | 99201 | country:fr |
49 Scenario: When the last postcode is deleted, it is deleted from postcode
51 | osm | class | type | addr+postcode | addr+housenumber | geometry |
52 | N34 | place | house | 01982 | 111 | country:de |
53 | N35 | place | house | 4567 | 5 | country:ch |
55 And marking for delete N34
56 And refreshing postcodes
57 Then location_postcodes contains exactly
58 | country_code | postcode | centroid!wkt |
59 | ch | 4567 | country:ch |
61 Scenario: A postcode is not deleted from postcode when it exist in another country
63 | osm | class | type | addr+postcode | addr+housenumber | geometry |
64 | N34 | place | house | 01982 | 111 | country:de |
65 | N35 | place | house | 01982 | 5 | country:fr |
67 And marking for delete N34
68 And refreshing postcodes
69 Then location_postcodes contains exactly
70 | country_code | postcode | centroid!wkt|
71 | fr | 01982 | country:fr |
73 Scenario: Updating a postcode is reflected in postcode table
75 | osm | class | type | addr+postcode | geometry |
76 | N34 | place | postcode | 01982 | country:de |
79 | osm | class | type | addr+postcode | geometry |
80 | N34 | place | postcode | 20453 | country:de |
81 And refreshing postcodes
82 Then location_postcodes contains exactly
83 | country_code | postcode | centroid!wkt |
84 | de | 20453 | country:de |
86 Scenario: When a parent is deleted, the postcode gets a new parent
87 Given the grid with origin DE
92 | osm | class | type | name | admin | geometry |
93 | R1 | boundary | administrative | Big | 6 | (1,4,6,2,1) |
94 | R2 | boundary | administrative | Small | 6 | (1,3,5,2,1) |
96 | osm | postcode | centroid |
99 Then location_postcodes contains exactly
100 | postcode | centroid!wkt | parent_place_id |
102 When marking for delete R2
103 Then location_postcodes contains exactly
104 | country_code | postcode | centroid!wkt | parent_place_id |
105 | de | 12345 | 9 | R1 |
107 Scenario: When a postcode area appears, postcode points are shadowed
108 Given the grid with origin DE
113 | osm | postcode | centroid |
117 Then location_postcodes contains exactly
118 | country_code | postcode | osm_id | centroid!wkt |
119 | de | 44321 | - | 9 |
120 | de | 00245 | - | 8 |
122 | osm | postcode | centroid | geometry |
123 | R45 | 00245 | 9 | (1,3,5,2,1) |
124 When refreshing postcodes
125 Then location_postcodes contains exactly
126 | country_code | postcode | osm_id | centroid!wkt |
127 | de | 00245 | 45 | 9 |
129 Scenario: When a postcode area disappears, postcode points are unshadowed
130 Given the grid with origin DE
135 | osm | postcode | centroid | geometry |
136 | R45 | 00245 | 9 | (1,3,5,2,1) |
138 | osm | postcode | centroid |
142 Then location_postcodes contains exactly
143 | country_code | postcode | osm_id | centroid!wkt |
144 | de | 00245 | 45 | 9 |
145 When marking for delete R45
146 And refreshing postcodes
147 Then location_postcodes contains exactly
148 | country_code | postcode | osm_id | centroid!wkt |
149 | de | 44321 | - | 9 |
150 | de | 00245 | - | 8 |