Browse Source

Fix flipped expected and actual parameters in main tests

feature/general-cleanup
Fabian Vowie 3 years ago
parent
commit
6c9e77907f
No known key found for this signature in database GPG Key ID: C27317C33B27C410
  1. 6
      main_test.go

6
main_test.go

@ -21,7 +21,7 @@ func TestIndexRoute(t *testing.T) {
IndexHandler(responseRecorder, request) 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") assert.NotNil(t, responseRecorder.Body, "Response should contain body")
}) })
} }
@ -44,7 +44,7 @@ func TestEndpointRoute(t *testing.T) {
router.ServeHTTP(responseRecorder, request) router.ServeHTTP(responseRecorder, request)
assert.Equal(t, responseRecorder.Code, 200)
assert.Equal(t, 200, responseRecorder.Code)
body, _ := json.Marshal(data) body, _ := json.Marshal(data)
assert.JSONEq(t, string(body), responseRecorder.Body.String()) assert.JSONEq(t, string(body), responseRecorder.Body.String())
}) })
@ -57,6 +57,6 @@ func TestEndpointRoute(t *testing.T) {
router.ServeHTTP(responseRecorder, request) router.ServeHTTP(responseRecorder, request)
assert.Equal(t, responseRecorder.Code, 404)
assert.Equal(t, 404, responseRecorder.Code)
}) })
} }
Loading…
Cancel
Save