diff options
author | ipknHama <ipknhama@gmail.com> | 2017-10-21 21:20:07 +0900 |
---|---|---|
committer | ipknHama <ipknhama@gmail.com> | 2017-12-25 15:31:20 +0900 |
commit | daa1e3eadcfb99bde158a6a9d9455d113b005df5 (patch) | |
tree | d73be02abca55b5001c76e9a91b14e9385f5c90e /tests/unittest.cpp | |
parent | 6876a08e61a67592b53a823260203a5e9cd04618 (diff) | |
download | crow-daa1e3eadcfb99bde158a6a9d9455d113b005df5.tar.gz crow-daa1e3eadcfb99bde158a6a9d9455d113b005df5.zip |
Add PURGE method, add a special enum item for counting
Diffstat (limited to 'tests/unittest.cpp')
-rw-r--r-- | tests/unittest.cpp | 16 |
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); |