aboutsummaryrefslogtreecommitdiffstats
path: root/test/static_handler_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-09-04 15:48:46 +0200
committerLoïc Hoguin <[email protected]>2017-09-04 15:48:46 +0200
commit0828e0b9ced1ae72c2d58cefe3a00ef5d3370670 (patch)
tree03eea83d4fb2258e57bec9834589424e366f653c /test/static_handler_SUITE.erl
parent58e9e76814a8291894ba01ac8a4551e4f8d480b3 (diff)
downloadcowboy-0828e0b9ced1ae72c2d58cefe3a00ef5d3370670.tar.gz
cowboy-0828e0b9ced1ae72c2d58cefe3a00ef5d3370670.tar.bz2
cowboy-0828e0b9ced1ae72c2d58cefe3a00ef5d3370670.zip
Alphabetical order some tests
Diffstat (limited to 'test/static_handler_SUITE.erl')
-rw-r--r--test/static_handler_SUITE.erl54
1 files 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, <<"<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.