0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

add inform3 test

This commit is contained in:
geeksilva97 2024-01-10 16:12:37 -03:00
parent fed6c5415c
commit 76e4786171
2 changed files with 4 additions and 0 deletions

View file

@ -155,6 +155,9 @@ do(<<"inform3">>, Req0, Opts) ->
case cowboy_req:binding(arg, Req0) of case cowboy_req:binding(arg, Req0) of
<<"binary">> -> <<"binary">> ->
cowboy_req:inform(<<"102 On my way">>, Headers, Req0); 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">> -> <<"error">> ->
ct_helper:ignore(cowboy_req, inform, 3), ct_helper:ignore(cowboy_req, inform, 3),
cowboy_req:inform(ok, Headers, Req0); cowboy_req:inform(ok, Headers, Req0);

View file

@ -897,6 +897,7 @@ inform3(Config) ->
{102, Headers, 200, _, _} = do_get_inform("/resp/inform3/102", Config), {102, Headers, 200, _, _} = do_get_inform("/resp/inform3/102", Config),
{102, Headers, 200, _, _} = do_get_inform("/resp/inform3/binary", 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/error", Config),
{500, _} = do_get_inform("/resp/inform3/set_cookie", Config),
{102, Headers, 200, _, _} = do_get_inform("/resp/inform3/twice", Config), {102, Headers, 200, _, _} = do_get_inform("/resp/inform3/twice", Config),
%% @todo How to test this properly? This isn't enough. %% @todo How to test this properly? This isn't enough.
{200, _} = do_get_inform("/resp/inform3/after_reply", Config), {200, _} = do_get_inform("/resp/inform3/after_reply", Config),