Skip to content

Commit e17f73a

Browse files
author
zsbahtiar
committed
test(integration): add assert error equal
1 parent 8c742ab commit e17f73a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/integration/api_repo_action_delete_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ package integration
22

33
import (
44
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
5+
actions_model "code.gitea.io/gitea/models/actions"
56
auth_model "code.gitea.io/gitea/models/auth"
67
"code.gitea.io/gitea/models/unittest"
78
user_model "code.gitea.io/gitea/models/user"
9+
"code.gitea.io/gitea/modules/util"
810
"code.gitea.io/gitea/tests"
11+
"context"
912
"fmt"
1013
"github.com/PuerkitoBio/goquery"
1114
"net/http"
@@ -219,6 +222,10 @@ jobs:
219222
}).AddTokenAuth(token).
220223
SetHeader("X-Csrf-Token", csrf)
221224
session.MakeRequest(t, reqDelete, http.StatusNoContent)
225+
226+
// should not found
227+
_, err := actions_model.GetRunsByIDsAndTriggerUserID(context.Background(), runIDs, user2.ID)
228+
assert.Error(t, fmt.Errorf("run with ids %d: %w", runIDs, util.ErrNotExist), err)
222229
doAPIDeleteRepository(httpContext)
223230
})
224231

0 commit comments

Comments
 (0)