aboutsummaryrefslogtreecommitdiff
path: root/test/03-api/03-fields/auth.janet
diff options
context:
space:
mode:
Diffstat (limited to 'test/03-api/03-fields/auth.janet')
-rw-r--r--test/03-api/03-fields/auth.janet14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/03-api/03-fields/auth.janet b/test/03-api/03-fields/auth.janet
new file mode 100644
index 0000000..d9d94d9
--- /dev/null
+++ b/test/03-api/03-fields/auth.janet
@@ -0,0 +1,14 @@
+(use ../../../jurl)
+(import spork/json)
+
+(def token "my token")
+
+(def req (->> "https://pie.dev/bearer"
+ (http :get)
+ (oauth token)))
+
+(def res (req))
+(assert (= 200 (res :status)))
+
+(def rtoken ((json/decode (res :body) true) :token))
+(assert (= token rtoken))