feat(workflow): example covers security, platform, enterprise and resilience features
105 route tests, matrix crawl, spec and README updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// Route: GET/POST /tenancy/flags (per-tenant overrides)
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
using molo::example::fw::Method;
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
Method P = Method::Post;
|
||||
auto def = f.client->request(Method::Get, "/tenancy/flags", "", {{"X-Tenant-ID", "acme"}});
|
||||
check(def.status == 200 && contains(def.body, "\"beta-ui\":false"), "default off");
|
||||
check(f.client->request(P, "/tenancy/flags", "flag=beta-ui&enabled=true", {{"X-Tenant-ID", "acme"}}).status == 200, "set");
|
||||
check(contains(f.client->request(Method::Get, "/tenancy/flags", "", {{"X-Tenant-ID", "acme"}}).body, "\"beta-ui\":true"), "override applied");
|
||||
check(contains(f.client->request(Method::Get, "/tenancy/flags", "", {{"X-Tenant-ID", "globex"}}).body, "\"beta-ui\":false"), "side effect: other tenant unchanged");
|
||||
check(f.client->request(P, "/tenancy/flags", "flag=nope&enabled=true", {{"X-Tenant-ID", "acme"}}).status == 422, "unknown flag");
|
||||
check(f.client->request(P, "/tenancy/flags", "flag=beta-ui&enabled=maybe", {{"X-Tenant-ID", "acme"}}).status == 422, "bad value");
|
||||
return finish("tenancy/flags");
|
||||
}
|
||||
Reference in New Issue
Block a user