Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf34431b

Browse files
committed
Correct dbauthz test
Signed-off-by: Danny Kopping <danny@coder.com>
1 parentf075341 commitf34431b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎coderd/database/dbauthz/dbauthz_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,8 @@ func (s *MethodTestSuite) TestSystemFunctions() {
24932493
}))
24942494
s.Run("FetchNewMessageMetadata",s.Subtest(func(db database.Store,check*expects) {
24952495
// TODO: update this test once we have a specific role for notifications
2496-
check.Args(database.FetchNewMessageMetadataParams{}).Asserts(rbac.ResourceSystem,policy.ActionRead)
2496+
u:=dbgen.User(s.T(),db, database.User{})
2497+
check.Args(database.FetchNewMessageMetadataParams{UserID:u.ID}).Asserts(rbac.ResourceSystem,policy.ActionRead)
24972498
}))
24982499
s.Run("GetNotificationMessagesByStatus",s.Subtest(func(db database.Store,check*expects) {
24992500
// TODO: update this test once we have a specific role for notifications

‎coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ func (q *FakeQuerier) FetchNewMessageMetadata(ctx context.Context, arg database.
18701870
return database.FetchNewMessageMetadataRow{},err
18711871
}
18721872

1873-
user,err:=q.GetUserByID(ctx,arg.UserID)
1873+
user,err:=q.getUserByIDNoLock(arg.UserID)
18741874
iferr!=nil {
18751875
return database.FetchNewMessageMetadataRow{},xerrors.Errorf("fetch user: %w",err)
18761876
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp