16 lines
488 B
C++
16 lines
488 B
C++
// Route: /ws/chat (websocket skeleton endpoint)
|
|||
|
|
#include "support/Assert.hpp"
|
||
|
|
|
||
|
|
using namespace molo::example::test;
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
Fixture f;
|
||
|
|
auto info = f.client->get("/ws/chat");
|
||
|
|
check(info.status == 200, "status 200");
|
||
|
|
check(contains(info.body, "\"protocol\":\"websocket\""),
|
||
|
|
"upgrade contract described");
|
||
|
|
auto echo = f.client->post("/ws/chat", "ping", "text/plain");
|
||
|
|
check(contains(echo.body, "\"echo\":\"ping\""), "frame echoed");
|
||
|
|
return finish("ws/chat");
|
||
|
|
}
|