aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittest.cpp')
-rw-r--r--tests/unittest.cpp16
1 files changed, 16 insertions, 0 deletions
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
@@ -381,6 +386,17 @@ TEST(http_method)
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;
+
req.url = "/get_only";
req.method = "POST"_method;
app.handle(req, res);