feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security, data, app, realtime, supervisor, clients, CLI, example plus enterprise tenancy, audit, operability, governance, supplychain. Postgres via docker compose for tests.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// Route: POST /validate/user (all-failures validation error)
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
auto ok = f.client->post(
|
||||
"/validate/user",
|
||||
"{\"username\":\"ada\",\"email\":\"ada@x.io\",\"age\":\"36\"}",
|
||||
"application/json");
|
||||
check(ok.status == 200, "valid model is 200");
|
||||
auto bad = f.client->post("/validate/user",
|
||||
"{\"username\":\"ad\",\"age\":\"old\"}",
|
||||
"application/json");
|
||||
check(bad.status == 422, "invalid model is 422");
|
||||
check(contains(bad.body, "username"), "username failure listed");
|
||||
check(contains(bad.body, "email"), "missing email listed");
|
||||
check(contains(bad.body, "age"), "bad age listed");
|
||||
return finish("validate/user");
|
||||
}
|
||||
Reference in New Issue
Block a user