17 lines
620 B
C++
17 lines
620 B
C++
// Route: GET /v2/items (current version: no deprecation headers)
|
|||
|
|
#include "support/Assert.hpp"
|
||
|
|
|
||
|
|
using namespace molo::example::test;
|
||
|
|
using molo::example::fw::Method;
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
Fixture f;
|
||
|
|
auto r = f.client->get("/v2/items");
|
||
|
|
check(r.status == 200 && contains(r.body, "\"v2\""), "ok");
|
||
|
|
check(r.headers.get("X-API-Version") == "v2", "version header");
|
||
|
|
check(!r.headers.has("Deprecation") && !r.headers.has("Sunset"), "no deprecation");
|
||
|
|
check(f.client->post("/v2/items").status == 405, "405 on post");
|
||
|
|
check(f.client->get("/v3/items").status == 404, "404 unknown version");
|
||
|
|
return finish("v2/items");
|
||
|
|
}
|