]> git.cworth.org Git - empires-server/commitdiff
test: Add test case for rejection of category that is far too large
authorCarl Worth <cworth@cworth.org>
Fri, 12 Jun 2020 00:07:20 +0000 (17:07 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 12 Jun 2020 00:07:20 +0000 (17:07 -0700)
As implemented in the previous commit.

test

diff --git a/test b/test
index 667d6ac380346619c4c1a6d7e38499f5a48bce7b..d419fc139556983923914cdea908022bc470eebc 100755 (executable)
--- a/test
+++ b/test
@@ -460,6 +460,11 @@ empathy_submit_prompt()
     curl_post $empathy_game_path/prompts "{ \"items\": $2, \"prompt\": \"$3\"}" "-b $1"
 }
 
+TEST "Huge numbers are rejected"
+result=$(empathy_submit_prompt $alice 10000 "10,000 Maniacs")
+test "$result" = '{"valid":false,"message":"Maximum number of items is 20"}'
+TEST_END
+
 TEST "Submit a category"
 prompt_id=$(empathy_submit_prompt $alice 4 "4 things on a beach" | jq .id)
 test "$prompt_id" = "1"