From 0828e0b9ced1ae72c2d58cefe3a00ef5d3370670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 4 Sep 2017 15:48:46 +0200 Subject: Alphabetical order some tests --- test/static_handler_SUITE.erl | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/test/static_handler_SUITE.erl b/test/static_handler_SUITE.erl index 95d6d75..26b7140 100644 --- a/test/static_handler_SUITE.erl +++ b/test/static_handler_SUITE.erl @@ -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, <<"

It works!

\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, <<"

It works!

\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, <<"

It works!

\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, <<"

It works!

\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. -- cgit v1.2.3