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

Alphabetical order some tests

This commit is contained in:
Loïc Hoguin 2017-09-04 15:48:46 +02:00
parent 58e9e76814
commit 0828e0b9ce
No known key found for this signature in database
GPG key ID: 71366FF21851DF03

View file

@ -209,6 +209,11 @@ bad_dir_route(Config) ->
{500, _, _} = do_get("/bad/dir/route", Config),
ok.
bad_file_in_priv_dir_in_ez_archive(Config) ->
doc("Get a missing file from a priv_dir stored in Erlang application .ez archive."),
{404, _, _} = do_get("/ez_priv_dir/index.php", Config),
ok.
bad_file_path(Config) ->
doc("Bad cowboy_static options: wrong path."),
{404, _, _} = do_get("/bad/file/path", Config),
@ -234,6 +239,11 @@ bad_priv_dir_app(Config) ->
{500, _, _} = do_get("/bad/priv_dir/app/style.css", Config),
ok.
bad_priv_dir_in_ez_archive(Config) ->
doc("Bad cowboy_static options: priv_dir path missing from Erlang application .ez archive."),
{404, _, _} = do_get("/bad/ez_priv_dir/index.html", Config),
ok.
bad_priv_dir_no_priv(Config) ->
doc("Bad cowboy_static options: application has no priv directory."),
{404, _, _} = do_get("/bad/priv_dir/no-priv/style.css", Config),
@ -254,6 +264,11 @@ bad_priv_file_app(Config) ->
{500, _, _} = do_get("/bad/priv_file/app", Config),
ok.
bad_priv_file_in_ez_archive(Config) ->
doc("Bad cowboy_static options: priv_file path missing from Erlang application .ez archive."),
{404, _, _} = do_get("/bad/ez_priv_file/index.php", Config),
ok.
bad_priv_file_no_priv(Config) ->
doc("Bad cowboy_static options: application has no priv directory."),
{404, _, _} = do_get("/bad/priv_file/no-priv", Config),
@ -731,12 +746,24 @@ mime_hardcode_tuple(Config) ->
{_, <<"application/vnd.ninenines.cowboy+xml;v=1">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
priv_dir_in_ez_archive(Config) ->
doc("Get a file from a priv_dir stored in Erlang application .ez archive."),
{200, Headers, <<"<h1>It works!</h1>\n">>} = do_get("/ez_priv_dir/index.html", Config),
{_, <<"text/html">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
priv_file(Config) ->
doc("Get a file with hardcoded route."),
{200, Headers, <<"body{color:red}\n">>} = do_get("/priv_file/style.css", Config),
{_, <<"text/css">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
priv_file_in_ez_archive(Config) ->
doc("Get a file stored in Erlang application .ez archive."),
{200, Headers, <<"<h1>It works!</h1>\n">>} = do_get("/ez_priv_file/index.html", Config),
{_, <<"text/html">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
unicode_basic_latin(Config) ->
doc("Get a file with non-urlencoded characters from Unicode Basic Latin block."),
_ = [case do_get("/char/" ++ [C], Config) of
@ -788,30 +815,3 @@ unknown_option(Config) ->
{200, Headers, <<"body{color:red}\n">>} = do_get("/unknown/option", Config),
{_, <<"text/css">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
priv_file_in_ez_archive(Config) ->
doc("Get a file stored in Erlang application .ez archive."),
{200, Headers, <<"<h1>It works!</h1>\n">>} = do_get("/ez_priv_file/index.html", Config),
{_, <<"text/html">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
bad_priv_file_in_ez_archive(Config) ->
doc("Bad cowboy_static options: priv_file path missing from Erlang application .ez archive."),
{404, _, _} = do_get("/bad/ez_priv_file/index.php", Config),
ok.
priv_dir_in_ez_archive(Config) ->
doc("Get a file from a priv_dir stored in Erlang application .ez archive."),
{200, Headers, <<"<h1>It works!</h1>\n">>} = do_get("/ez_priv_dir/index.html", Config),
{_, <<"text/html">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
bad_file_in_priv_dir_in_ez_archive(Config) ->
doc("Get a missing file from a priv_dir stored in Erlang application .ez archive."),
{404, _, _} = do_get("/ez_priv_dir/index.php", Config),
ok.
bad_priv_dir_in_ez_archive(Config) ->
doc("Bad cowboy_static options: priv_dir path missing from Erlang application .ez archive."),
{404, _, _} = do_get("/bad/ez_priv_dir/index.html", Config),
ok.