From e7b491a7de58b647f99f940401c23091cd650427 Mon Sep 17 00:00:00 2001 From: Arlan Lloyd Date: Sun, 30 Mar 2025 17:01:09 +0000 Subject: [PATCH] add hurl test --- content/blogs/phantom-token/shell.nix | 1 + content/blogs/phantom-token/test.hurl | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 content/blogs/phantom-token/test.hurl diff --git a/content/blogs/phantom-token/shell.nix b/content/blogs/phantom-token/shell.nix index 8004e63..67bf5e6 100644 --- a/content/blogs/phantom-token/shell.nix +++ b/content/blogs/phantom-token/shell.nix @@ -3,5 +3,6 @@ pkgs.mkShell { packages = with pkgs; [ bun go + hurl ]; } diff --git a/content/blogs/phantom-token/test.hurl b/content/blogs/phantom-token/test.hurl new file mode 100644 index 0000000..c5563ad --- /dev/null +++ b/content/blogs/phantom-token/test.hurl @@ -0,0 +1,12 @@ +POST http://localhost:7891/auth/user +{ "name": "pina" } +HTTP 201 +[Captures] +session_token: jsonpath "$['token']" + +GET http://localhost:7891/api/me +authorization: Bearer {{session_token}} +HTTP 200 +[Asserts] +jsonpath "$['sub']" == "pina" +jsonpath "$['iss']" == "keibi-blog" \ No newline at end of file