Minor changes
This commit is contained in:
parent
0e81dc4e92
commit
8f0cdd45e0
13
main_test.go
13
main_test.go
@ -9,10 +9,11 @@ import (
|
||||
)
|
||||
|
||||
func TestRoutes(t *testing.T) {
|
||||
expectedStatus := http.StatusOK
|
||||
|
||||
app := configure(aero.New())
|
||||
request, err := http.NewRequest("GET", "/", nil)
|
||||
|
||||
for _, examples := range tests {
|
||||
for _, example := range examples {
|
||||
request, err := http.NewRequest("GET", example, nil)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -21,7 +22,9 @@ func TestRoutes(t *testing.T) {
|
||||
responseRecorder := httptest.NewRecorder()
|
||||
app.Handler().ServeHTTP(responseRecorder, request)
|
||||
|
||||
if status := responseRecorder.Code; status != expectedStatus {
|
||||
t.Errorf("Wrong status code: %v instead of %v", status, expectedStatus)
|
||||
if status := responseRecorder.Code; status != http.StatusOK {
|
||||
t.Errorf("%s | Wrong status code | %v instead of %v", example, status, http.StatusOK)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user