diff --git a/tests/alltest.nim b/tests/alltest.nim index 202e9b2..f45ed9f 100644 --- a/tests/alltest.nim +++ b/tests/alltest.nim @@ -218,5 +218,8 @@ routes: get "/query": resp $request.params + get "/querystring": + resp $request.query + get "/issue157": resp(Http200, [("Content-Type","text/css")] , "foo") diff --git a/tests/tester.nim b/tests/tester.nim index 1e26170..c2222a4 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -146,6 +146,10 @@ proc allTest(useStdLib: bool) = let resp = waitFor client.get(address & "/foo/query?q=test") check (waitFor resp.body) == """{"q": "test"}""" + test "can access querystring": + let resp = waitFor client.get(address & "/foo/querystring?q=test&field=5") + check (waitFor resp.body) == "q=test&field=5" + test "issue 157": let resp = waitFor client.get(address & "/foo/issue157") let headers = resp.headers @@ -261,4 +265,4 @@ when isMainModule: let path = "tests/nim-in-action-code/Chapter7/Tweeter/src/tweeter.nim" check execCmd("nim c --path:. " & path) == QuitSuccess finally: - doAssert execCmd("kill -15 " & $serverProcess.processID()) == QuitSuccess \ No newline at end of file + doAssert execCmd("kill -15 " & $serverProcess.processID()) == QuitSuccess