From 8b01385465a2a1366ca2a62a99211140a9c62fa2 Mon Sep 17 00:00:00 2001 From: BooD Date: Thu, 5 Oct 2017 18:13:40 +0300 Subject: Add HTTP PATCH support --- tests/unittest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/unittest.cpp b/tests/unittest.cpp index 303fa72..bffdd60 100644 --- a/tests/unittest.cpp +++ b/tests/unittest.cpp @@ -324,6 +324,11 @@ TEST(http_method) ([](const request& /*req*/){ return "post"; }); + CROW_ROUTE(app, "/patch_only") + .methods("PATCH"_method) + ([](const request& /*req*/){ + return "patch"; + }); // cannot have multiple handlers for the same url @@ -361,6 +366,17 @@ TEST(http_method) ASSERT_EQUAL("get", res.body); } + { + request req; + response res; + + req.url = "/patch_only"; + req.method = "PATCH"_method; + app.handle(req, res); + + ASSERT_EQUAL("patch", res.body); + } + { request req; response res; -- cgit v1.2.3-54-g00ecf