Skip to content

Commit

Permalink
test(api): error 404
Browse files Browse the repository at this point in the history
  • Loading branch information
sundowndev committed Mar 27, 2020
1 parent 52dbce3 commit 7dc9785
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions api/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ func TestApi(t *testing.T) {
// assert.Equal(string(body), "{\"success\":true,\"version\":\""+config.Version+"\"}", "should be equal")
// })

// t.Run("404 error - /api/notfound", func(t *testing.T) {
// res, err := performRequest(r, "GET", "/api/notfound")
t.Run("404 error - /api/notfound", func(t *testing.T) {
res, err := performRequest(r, "GET", "/api/notfound")

// body, _ := ioutil.ReadAll(res.Body)
body, _ := ioutil.ReadAll(res.Body)

// assert.Equal(err, nil, "should be equal")
// assert.Equal(res.Result().StatusCode, 404, "should be equal")
// assert.Equal(string(body), "{\"success\":false,\"error\":\"Resource not found\"}", "should be equal")
// })
assert.Equal(err, nil, "should be equal")
assert.Equal(res.Result().StatusCode, 404, "should be equal")
assert.Equal(string(body), "{\"success\":false,\"error\":\"Resource not found\"}", "should be equal")
})
})
}
2 changes: 1 addition & 1 deletion pkg/scanners/scanners.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func ovhScanCLI(l *utils.Logger, number *Number) *OVHScannerResponse {
scan, err := OVHScan(number)

if err != nil {
l.Errorln("An error ocurred")
l.Errorln("An error occurred")
os.Exit(0)
}

Expand Down

0 comments on commit 7dc9785

Please sign in to comment.