aboutsummaryrefslogtreecommitdiffstats
path: root/test/http_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-01-29 21:24:04 +0100
committerLoïc Hoguin <[email protected]>2013-01-29 21:24:04 +0100
commitec52b4f4df70a114bca56a19535739ae3788166a (patch)
tree092ef2ed715873bc2595a409d43d04c9dba956c1 /test/http_SUITE.erl
parentfd5a977a39ec99d0aa57a2864f91cca7af5c67d6 (diff)
parent8a798014e980d596e631cf5f24957ee15f9a1ac4 (diff)
downloadcowboy-ec52b4f4df70a114bca56a19535739ae3788166a.tar.gz
cowboy-ec52b4f4df70a114bca56a19535739ae3788166a.tar.bz2
cowboy-ec52b4f4df70a114bca56a19535739ae3788166a.zip
Merge branch 'rest_post_created_path' of https://github.com/treetopllc/cowboy
Diffstat (limited to 'test/http_SUITE.erl')
-rw-r--r--test/http_SUITE.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 492863f..0b35cf3 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -50,6 +50,7 @@
-export([onresponse_reply/1]).
-export([pipeline/1]).
-export([rest_bad_accept/1]).
+-export([rest_created_path/1]).
-export([rest_expires/1]).
-export([rest_keepalive/1]).
-export([rest_keepalive_post/1]).
@@ -112,6 +113,7 @@ groups() ->
nc_zero,
pipeline,
rest_bad_accept,
+ rest_created_path,
rest_expires,
rest_keepalive,
rest_keepalive_post,
@@ -334,6 +336,7 @@ init_dispatch(Config) ->
{"/missing_put_callbacks", rest_missing_callbacks, []},
{"/nodelete", rest_nodelete_resource, []},
{"/patch", rest_patch_resource, []},
+ {"/created_path", rest_created_path_resource, []},
{"/resetags", rest_resource_etags, []},
{"/rest_expires", rest_expires, []},
{"/loop_timeout", http_handler_loop_timeout, []},
@@ -763,6 +766,18 @@ rest_bad_accept(Config) ->
Client),
{ok, 400, _, _} = cowboy_client:response(Client2).
+rest_created_path(Config) ->
+ Headers = [{<<"content-type">>, <<"text/plain">>}],
+ Body = <<"Whatever">>,
+ Client = ?config(client, Config),
+ URL = build_url("/created_path", Config),
+ {ok, Client2} = cowboy_client:request(<<"POST">>, URL, Headers,
+ Body, Client),
+ {ok, 303, ResHeaders, _} = cowboy_client:response(Client2),
+ {<<"location">>, _Location} =
+ lists:keyfind(<<"location">>, 1, ResHeaders),
+ ok.
+
rest_expires(Config) ->
Client = ?config(client, Config),
{ok, Client2} = cowboy_client:request(<<"GET">>,