From 76e47861712128fe4088a2e36253c2d6842faf36 Mon Sep 17 00:00:00 2001 From: geeksilva97 Date: Wed, 10 Jan 2024 16:12:37 -0300 Subject: [PATCH] add inform3 test --- test/handlers/resp_h.erl | 3 +++ test/req_SUITE.erl | 1 + 2 files changed, 4 insertions(+) diff --git a/test/handlers/resp_h.erl b/test/handlers/resp_h.erl index 4830c723..9faf09be 100644 --- a/test/handlers/resp_h.erl +++ b/test/handlers/resp_h.erl @@ -155,6 +155,9 @@ do(<<"inform3">>, Req0, Opts) -> case cowboy_req:binding(arg, Req0) of <<"binary">> -> cowboy_req:inform(<<"102 On my way">>, Headers, Req0); + <<"set_cookie">> -> + ct_helper:ignore(cowboy_req, inform, 3), + cowboy_req:inform(ok, #{<<"set-cookie">> => <<"name=paco loco">>}, Req0); <<"error">> -> ct_helper:ignore(cowboy_req, inform, 3), cowboy_req:inform(ok, Headers, Req0); diff --git a/test/req_SUITE.erl b/test/req_SUITE.erl index a037db2d..dada6b98 100644 --- a/test/req_SUITE.erl +++ b/test/req_SUITE.erl @@ -897,6 +897,7 @@ inform3(Config) -> {102, Headers, 200, _, _} = do_get_inform("/resp/inform3/102", Config), {102, Headers, 200, _, _} = do_get_inform("/resp/inform3/binary", Config), {500, _} = do_get_inform("/resp/inform3/error", Config), + {500, _} = do_get_inform("/resp/inform3/set_cookie", Config), {102, Headers, 200, _, _} = do_get_inform("/resp/inform3/twice", Config), %% @todo How to test this properly? This isn't enough. {200, _} = do_get_inform("/resp/inform3/after_reply", Config),