From ea1ff6d33840267c7b908683bbde63efe931441e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ja=C5=A1ek?= Date: Fri, 15 Dec 2023 10:17:50 +0100 Subject: [PATCH] test mgmt api user locale validation (#155) CPCN-439 --- server/features/mgmt_api_users.feature | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/server/features/mgmt_api_users.feature b/server/features/mgmt_api_users.feature index 24b1207..149c092 100644 --- a/server/features/mgmt_api_users.feature +++ b/server/features/mgmt_api_users.feature @@ -181,3 +181,38 @@ Feature: Management API - Users } """ Then we get response code 200 + + Scenario: Validate locale + + Given "companies" + """ + [{"name": "zzz company"}] + """ + + When we post to "/users" + """ + { + "first_name": "John", + "last_name": "Cena", + "email": "johncena@wwe.com", + "company": "#companies._id#", + "locale": "fr" + } + """ + + Then we get error 400 + """ + {"code": 400, "message": "Locale is not in configured list of locales."} + """ + + When we post to "/users" + """ + { + "first_name": "John", + "last_name": "Cena", + "email": "johncena@wwe.com", + "company": "#companies._id#", + "locale": "fr_CA" + } + """ + Then we get response code 201