From 1060e35019cc0086aafc4cbd6dc56345b12319a2 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Mon, 16 Oct 2023 21:11:57 -0600 Subject: [PATCH] Add test for get users --- .../kotlin/com/wbrawner/twigs/server/api/UserRouteTest.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/test/kotlin/com/wbrawner/twigs/server/api/UserRouteTest.kt b/app/src/test/kotlin/com/wbrawner/twigs/server/api/UserRouteTest.kt index c07d739..b08b0e6 100644 --- a/app/src/test/kotlin/com/wbrawner/twigs/server/api/UserRouteTest.kt +++ b/app/src/test/kotlin/com/wbrawner/twigs/server/api/UserRouteTest.kt @@ -212,4 +212,10 @@ class UserRouteTest : ApiTest() { assertEquals("", savedUser.email) assertEquals("\$2a\$10\$bETxbFPja1PyXVLybETxb.CWBYzyYdZpmCcA7NSIN8dkdzidt1Xv2", savedUser.password) } + + @Test + fun `get users requires authentication`() = apiTest { client -> + val response = client.get("/api/users") + assertEquals(HttpStatusCode.Unauthorized, response.status) + } } \ No newline at end of file