diff options
author | Jaeseung Ha <ipknhama@gmail.com> | 2017-10-21 20:51:35 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 20:51:35 +0900 |
commit | 7f3f72441c242836d00ab2109a83baef89c08aaa (patch) | |
tree | 0598733459893098dd478e80327b047aa06095f9 /tests | |
parent | 53af5043ac6f77cb8580c13b50956bf97819eb69 (diff) | |
parent | 8b01385465a2a1366ca2a62a99211140a9c62fa2 (diff) | |
download | crow-7f3f72441c242836d00ab2109a83baef89c08aaa.tar.gz crow-7f3f72441c242836d00ab2109a83baef89c08aaa.zip |
Merge pull request #253 from boodkb/patch_method
Add support for HTTP PATCH method
Diffstat (limited to 'tests')
-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 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 @@ -365,6 +370,17 @@ TEST(http_method) 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; + req.url = "/get_only"; req.method = "POST"_method; app.handle(req, res); |