Files
moloapp/tests/example/doos/page_test.cpp
T

21 lines
764 B
C++
Raw Normal View History

// Route: GET /doos (sandboxed containers page)
#include "support/Assert.hpp"
#include "support/DoosHome.hpp"
using namespace molo::example::test;
int main() {
ScratchDoosHome home("page");
Fixture f;
auto res = f.client->get("/doos");
check(res.status == 200, "status 200");
check(contains(res.body, "Sandboxed containers"), "heading");
check(contains(res.body, "0 containers"), "empty demo store");
auto made = f.client->post("/doos/create", "name=web1", "application/x-www-form-urlencoded");
check(made.status == 200, "create 200");
auto again = f.client->get("/doos");
check(contains(again.body, "1 containers"), "count follows creates");
check(contains(again.body, "web1"), "row names the container");
return finish("doos/page");
}