fix: use require.Error instead of assert.Error for error assertions
This commit is contained in:
parent
4b91e5efa1
commit
b7a1408098
|
|
@ -23,6 +23,7 @@ import (
|
|||
bgHandler "code.vikunja.io/api/pkg/modules/background/handler"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestProjectBackgroundDeletePermission(t *testing.T) {
|
||||
|
|
@ -41,7 +42,7 @@ func TestProjectBackgroundDeletePermission(t *testing.T) {
|
|||
)
|
||||
|
||||
// Should be forbidden for a read-only user
|
||||
assert.Error(t, err)
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, http.StatusForbidden, getHTTPErrorCode(err))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ func TestTaskCommentIDOR(t *testing.T) {
|
|||
"task": "1", // task accessible to testuser1
|
||||
"commentid": "18", // comment belonging to task 34, NOT accessible to testuser1
|
||||
})
|
||||
assert.Error(t, err)
|
||||
require.Error(t, err)
|
||||
assertHandlerErrorCode(t, err, models.ErrCodeTaskCommentDoesNotExist)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue