From 526a55623dadffbf4bc44cbe864507a93f56115c Mon Sep 17 00:00:00 2001 From: Fabian Vowie Date: Fri, 21 Jan 2022 18:21:34 +0100 Subject: [PATCH] Fix flipped expected and actual parameters in main tests --- main_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main_test.go b/main_test.go index 6f33974..1c0feeb 100644 --- a/main_test.go +++ b/main_test.go @@ -21,7 +21,7 @@ func TestIndexRoute(t *testing.T) { IndexHandler(responseRecorder, request) - assert.Equal(t, responseRecorder.Code, 200, "Response code should be 200") + assert.Equal(t, 200, responseRecorder.Code, "Response code should be 200") assert.NotNil(t, responseRecorder.Body, "Response should contain body") }) } @@ -44,7 +44,7 @@ func TestEndpointRoute(t *testing.T) { router.ServeHTTP(responseRecorder, request) - assert.Equal(t, responseRecorder.Code, 200) + assert.Equal(t, 200, responseRecorder.Code) body, _ := json.Marshal(data) assert.JSONEq(t, string(body), responseRecorder.Body.String()) }) @@ -57,6 +57,6 @@ func TestEndpointRoute(t *testing.T) { router.ServeHTTP(responseRecorder, request) - assert.Equal(t, responseRecorder.Code, 404) + assert.Equal(t, 404, responseRecorder.Code) }) }