aboutsummaryrefslogtreecommitdiffstats
path: root/test/req_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-09-27 16:20:38 +0200
committerLoïc Hoguin <[email protected]>2017-09-27 16:20:38 +0200
commitfda2d150db460dfe66f307d976be021b7fa47722 (patch)
tree633b02663da15a7a7e5d8a19b6a4ddb545725963 /test/req_SUITE.erl
parent5fe46ebe64b3fe6c89840691a4172eb5852f0fba (diff)
downloadcowboy-fda2d150db460dfe66f307d976be021b7fa47722.tar.gz
cowboy-fda2d150db460dfe66f307d976be021b7fa47722.tar.bz2
cowboy-fda2d150db460dfe66f307d976be021b7fa47722.zip
Fix error response when constraint validation fails
Diffstat (limited to 'test/req_SUITE.erl')
-rw-r--r--test/req_SUITE.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/req_SUITE.erl b/test/req_SUITE.erl
index 3a223d9..66d42c9 100644
--- a/test/req_SUITE.erl
+++ b/test/req_SUITE.erl
@@ -171,6 +171,9 @@ match_cookies(Config) ->
<<"#{c => <<\"d\">>}">> = do_get_body("/match/cookies/c", [{<<"cookie">>, "a=b; c=d"}], Config),
<<"#{a => <<\"b\">>,c => <<\"d\">>}">> = do_get_body("/match/cookies/a/c",
[{<<"cookie">>, "a=b; c=d"}], Config),
+ %% Ensure match errors result in a 400 response.
+ {400, _, _} = do_get("/match/cookies/a/c",
+ [{<<"cookie">>, "a=b"}], Config),
%% This function is tested more extensively through unit tests.
ok.
@@ -183,6 +186,8 @@ match_qs(Config) ->
<<"#{a => <<\"b\">>,c => <<\"d\">>}">> = do_get_body("/match/qs/a/c?a=b&c=d", Config),
<<"#{a => <<\"b\">>,c => true}">> = do_get_body("/match/qs/a/c?a=b&c", Config),
<<"#{a => true,c => <<\"d\">>}">> = do_get_body("/match/qs/a/c?a&c=d", Config),
+ %% Ensure match errors result in a 400 response.
+ {400, _, _} = do_get("/match/qs/a/c?a=b", [], Config),
%% This function is tested more extensively through unit tests.
ok.