diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-07-25 19:05:07 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-07-25 19:05:07 +0800 |
commit | a3dc2cc367696a80c2f574762078d5b2c54fc7c0 (patch) | |
tree | f2ce894ace17dae38742c022ed3877784d1c631e | |
parent | eda381a1c6aa2db9d10195963f71c68d798cfb17 (diff) | |
download | cask-a3dc2cc367696a80c2f574762078d5b2c54fc7c0.tar.gz cask-a3dc2cc367696a80c2f574762078d5b2c54fc7c0.tar.bz2 cask-a3dc2cc367696a80c2f574762078d5b2c54fc7c0.zip |
FormJsonPost test
-rw-r--r-- | cask/test/src/test/cask/ExampleTests.scala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cask/test/src/test/cask/ExampleTests.scala b/cask/test/src/test/cask/ExampleTests.scala index 6644c83..b4a49c7 100644 --- a/cask/test/src/test/cask/ExampleTests.scala +++ b/cask/test/src/test/cask/ExampleTests.scala @@ -71,7 +71,7 @@ object ExampleTests extends TestSuite{ } 'MultipartFileUploads - test(MultipartFileUploads){ host => - val resp = requests.get( + val resp = requests.post( host + "/upload", data = requests.MultiPart( requests.MultiItem("image", "...", "my-best-image.txt") @@ -79,5 +79,16 @@ object ExampleTests extends TestSuite{ ) resp.text() ==> "my-best-image.txt" } + 'FormJsonPost - test(FormJsonPost){ host => + requests.post(host + "/json", data = """{"value1": true, "value2": [1, 2]""") ==> + "OK true [1, 2]" + + requests.post( + host + "/form", + data = Seq("value1" -> "hello", "value2" -> "1", "value2" -> "2") + ) ==> + "OK hello 1 2" + + } } } |