105 route tests, matrix crawl, spec and README updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
22 lines
1.3 KiB
C++
22 lines
1.3 KiB
C++
// Route: GET /audit/subject, export, POST erase (data subject rights)
|
|
#include "support/Assert.hpp"
|
|
|
|
using namespace molo::example::test;
|
|
using molo::example::fw::Method;
|
|
|
|
int main() {
|
|
Fixture f;
|
|
auto page = f.client->get("/audit/subject");
|
|
check(page.status == 200 && contains(page.headers.get("Content-Type"), "text/html"), "form page");
|
|
auto ex = f.client->get("/audit/subject/export?subject=ada@example.com");
|
|
check(ex.status == 200 && contains(ex.body, "order=1001") && contains(ex.body, "profiles"), "export across tables");
|
|
check(f.client->get("/audit/subject/export").status == 400, "missing subject");
|
|
auto bad = f.client->post("/audit/subject/erase", "subject=nope&confirm=no", "application/x-www-form-urlencoded");
|
|
check(bad.status == 422 && contains(bad.body, "field-error"), "inline errors");
|
|
auto ok = f.client->post("/audit/subject/erase", "subject=ada%40example.com&confirm=yes", "application/x-www-form-urlencoded");
|
|
check(ok.status == 200 && contains(ok.body, "4 rows erased"), "cascade erased 4 rows");
|
|
check(!contains(f.client->get("/audit/subject/export?subject=ada@example.com").body, "order="), "side effect: data gone");
|
|
check(contains(f.client->get("/audit/verify").body, "\"intact\":true"), "erasure audited, chain intact");
|
|
return finish("audit/subject");
|
|
}
|