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) }) }