summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-05-05 00:54:45 +0200
committerLinus Nordberg <linus@nordberg.se>2014-05-05 00:54:45 +0200
commitbf6fc033b757ae4b572ab6ff7fff332236525791 (patch)
tree9d6c1adcbe6167e92607d59dc8b72f7c3709042d /test
parent2fa51dcc2ef903e4247470f366f4463b05036838 (diff)
Add support for get-sth.
Diffstat (limited to 'test')
-rw-r--r--test/ctls_test.erl17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/ctls_test.erl b/test/ctls_test.erl
index d859b6e..bd477de 100644
--- a/test/ctls_test.erl
+++ b/test/ctls_test.erl
@@ -4,12 +4,13 @@
%% Requires that ctls is running (or, at the moment, that v1 has been
%% installed as an mod_esi module -- use https_server:start()).
+-define(URL, "https://flimsytest:8080/ct/v1/add_chain").
+
add_chain_test_() ->
{setup,
fun() ->
- Url = "https://flimsytest:8080/ct/v1/add_chain",
Input = "{\"chain\": [\"some test data\"]}",
- {OK, {{_, RC, _}, _, _}} = httpc:request(post, {Url, [], [], Input}, [], []),
+ {OK, {{_, RC, _}, _, _}} = httpc:request(post, {?URL, [], [], Input}, [], []),
%% TODO: Verify signature.
{OK, RC}
end,
@@ -18,3 +19,15 @@ add_chain_test_() ->
[?_assertEqual(ok, OK),
?_assertEqual(RC, 200)]
end}.
+
+add_sth_test_() ->
+ {setup,
+ fun() ->
+ {OK, {{_, RC, _}, _, _}} = httpc:request(get, {?URL, []}, [], []),
+ {OK, RC}
+ end,
+ fun(_) -> ok end,
+ fun({OK, RC}) ->
+ [?_assertEqual(ok, OK),
+ ?_assertEqual(RC, 200)]
+ end}.