aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-04-03 10:46:28 -0400
committerChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-04-03 10:46:28 -0400
commit1388e78f98cbb6d94fc058c39cfc98614b5b467e (patch)
tree7c9f37fd52b5b967ff36e755412bfcea5194fb7c
parentnative: make strings more permissive (diff)
test: test json api
-rw-r--r--test/03-api/03-fields/json.janet14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/03-api/03-fields/json.janet b/test/03-api/03-fields/json.janet
new file mode 100644
index 0000000..a0d5aea
--- /dev/null
+++ b/test/03-api/03-fields/json.janet
@@ -0,0 +1,14 @@
+(use ../../../jurl)
+(import spork/json)
+
+(def body {:abc "xyz"
+ :foo "bar"})
+
+(def req (->> "https://pie.dev/post"
+ (http :post)
+ (json body)))
+(def res (req))
+(assert (= 200 (res :status)))
+(def jes (freeze ((json/decode (res :body) true) :json)))
+
+(assert (= body jes))