From: Carl Worth Date: Mon, 1 Jun 2020 00:27:18 +0000 (-0700) Subject: test: Extend test case to include the LMNO redirects X-Git-Url: https://git.cworth.org/git?p=lmno-server;a=commitdiff_plain;h=8feb9aea1b02a89d5ddc316925914acdfeb0d173 test: Extend test case to include the LMNO redirects Obviously, this is functionality we don't want to break in any current (or future) code refactoring. --- diff --git a/test b/test index b5be7d8..017f38e 100755 --- a/test +++ b/test @@ -140,6 +140,24 @@ tictactoe_game_id=$(new_game tictactoe) test "$tictactoe_game_id" != "" TEST_END $tictactoe_game_id +TEST_SUBSECTION "Test redirects" + +TEST "Redirect of /GAMEID at top level" +redirect=$(curl_get $empires_game_id) +test "$redirect" = "Moved Permanently. Redirecting to /empires/$empires_game_id/" +TEST_END + +TEST "Redirect of lowercase /gameid at top level" +empires_game_id_lower=$(tr '[:upper:]' '[:lower:]' <<< $empires_game_id) +redirect=$(curl_get $empires_game_id_lower) +test "$redirect" = "Moved Permanently. Redirecting to /$empires_game_id/" +TEST_END + +TEST "Redirect of lowercase /empires/gameid" +redirect=$(curl_get empires/$empires_game_id_lower) +test "$redirect" = "Moved Permanently. Redirecting to /empires/$empires_game_id/" +TEST_END + TEST_SECTION "Empires game" empires_game_path=empires/$empires_game_id