From df1886632b91cdd225caf2c793405d02af422419 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Fri, 12 Jul 2024 20:10:47 +0200 Subject: [PATCH] Fix tests --- server/router/handler/lnauth_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/router/handler/lnauth_test.go b/server/router/handler/lnauth_test.go index 0cb923b..607c7f2 100644 --- a/server/router/handler/lnauth_test.go +++ b/server/router/handler/lnauth_test.go @@ -155,8 +155,9 @@ func TestLnAuthSignupCallbackUserExists(t *testing.T) { c = e.NewContext(req, rec) // must throw error because user already exists - err = handler.HandleLnAuthCallback(sc)(c) - assert.ErrorContains(err, "user already exists", "user check failed") + handler.HandleLnAuthCallback(sc)(c) + assert.Equalf(http.StatusBadRequest, rec.Code, "wrong status code") + assert.Contains(rec.Body.String(), "\"reason\":\"user already exists\"", "user check failed") } func TestLnAuthLogin(t *testing.T) { @@ -232,8 +233,9 @@ func TestLnAuthLoginCallbackUserNotExists(t *testing.T) { c = e.NewContext(req, rec) // must throw error because user does not exist - err = handler.HandleLnAuthCallback(sc)(c) - assert.ErrorContains(err, "user not found", "user check failed") + handler.HandleLnAuthCallback(sc)(c) + assert.Equalf(http.StatusNotFound, rec.Code, "wrong status code") + assert.Contains(rec.Body.String(), "\"reason\":\"user not found\"", "user check failed") } func TestLnAuthLoginCallbackUserExists(t *testing.T) {