From daa1e3eadcfb99bde158a6a9d9455d113b005df5 Mon Sep 17 00:00:00 2001 From: ipknHama Date: Sat, 21 Oct 2017 21:20:07 +0900 Subject: Add PURGE method, add a special enum item for counting --- tests/unittest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/unittest.cpp') diff --git a/tests/unittest.cpp b/tests/unittest.cpp index 6fe1bbd..e21af39 100644 --- a/tests/unittest.cpp +++ b/tests/unittest.cpp @@ -329,6 +329,11 @@ TEST(http_method) ([](const request& /*req*/){ return "patch"; }); + CROW_ROUTE(app, "/purge_only") + .methods("PURGE"_method) + ([](const request& /*req*/){ + return "purge"; + }); // cannot have multiple handlers for the same url @@ -377,6 +382,17 @@ TEST(http_method) ASSERT_EQUAL("patch", res.body); } + { + request req; + response res; + + req.url = "/purge_only"; + req.method = "PURGE"_method; + app.handle(req, res); + + ASSERT_EQUAL("purge", res.body); + } + { request req; response res; -- cgit v1.2.3-54-g00ecf