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