]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/details/language.feature
release 5.1.0.post5
[nominatim.git] / test / bdd / features / api / details / language.feature
1 Feature: Localization of search results
2
3     Scenario: default language
4         When sending v1/details
5           | osmtype | osmid   |
6           | R       | 1155955 |
7         Then a HTTP 200 is returned
8         And the result is valid json
9         And the result contains
10           | localname |
11           | Liechtenstein |
12
13     Scenario: accept-language first
14         When sending v1/details
15           | osmtype | osmid   | accept-language |
16           | R       | 1155955 | zh,de |
17         Then a HTTP 200 is returned
18         And the result is valid json
19         And the result contains
20           | localname |
21           | 列支敦士登 |
22
23     Scenario: accept-language missing
24         When sending v1/details
25           | osmtype | osmid   | accept-language |
26           | R       | 1155955 | xx,fr,en,de |
27         Then a HTTP 200 is returned
28         And the result is valid json
29         And the result contains
30           | localname |
31           | Liechtenstein |
32
33     Scenario: http accept language header first
34         Given the HTTP header
35           | accept-language |
36           | fo;q=0.8,en-ca;q=0.5,en;q=0.3 |
37         When sending v1/details
38           | osmtype | osmid   |
39           | R       | 1155955 |
40         Then a HTTP 200 is returned
41         And the result is valid json
42         And the result contains
43           | localname |
44           | Liktinstein |
45
46     Scenario: http accept language header and accept-language
47         Given the HTTP header
48           | accept-language |
49           | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3 |
50         When sending v1/details
51           | osmtype | osmid   | accept-language |
52           | R       | 1155955 | fo,en |
53         Then a HTTP 200 is returned
54         And the result is valid json
55         And the result contains
56           | localname |
57           | Liktinstein |
58
59     Scenario: http accept language header fallback
60         Given the HTTP header
61           | accept-language |
62           | fo-ca,en-ca;q=0.5 |
63         When sending v1/details
64           | osmtype | osmid   |
65           | R       | 1155955 |
66         Then a HTTP 200 is returned
67         And the result is valid json
68         And the result contains
69           | localname |
70           | Liktinstein |
71
72     Scenario: http accept language header fallback (upper case)
73         Given the HTTP header
74           | accept-language |
75           | fo-FR;q=0.8,en-ca;q=0.5 |
76         When sending v1/details
77           | osmtype | osmid   |
78           | R       | 1155955 |
79         Then a HTTP 200 is returned
80         And the result is valid json
81         And the result contains
82           | localname |
83           | Liktinstein |