mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
chore(coderd/httpmw): remove dbmem usage from tests (#18146)
Related to https://github.com/coder/coder/issues/15109
This commit is contained in:
@ -14,7 +14,7 @@ import (
|
||||
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
"github.com/coder/coder/v2/coderd/database/dbgen"
|
||||
"github.com/coder/coder/v2/coderd/database/dbmem"
|
||||
"github.com/coder/coder/v2/coderd/database/dbtestutil"
|
||||
"github.com/coder/coder/v2/coderd/httpmw"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
)
|
||||
@ -70,7 +70,7 @@ func TestRateLimit(t *testing.T) {
|
||||
t.Run("RegularUser", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
db := dbmem.New()
|
||||
db, _ := dbtestutil.NewDB(t)
|
||||
u := dbgen.User(t, db, database.User{})
|
||||
_, key := dbgen.APIKey(t, db, database.APIKey{UserID: u.ID})
|
||||
|
||||
@ -113,7 +113,7 @@ func TestRateLimit(t *testing.T) {
|
||||
t.Run("OwnerBypass", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
db := dbmem.New()
|
||||
db, _ := dbtestutil.NewDB(t)
|
||||
|
||||
u := dbgen.User(t, db, database.User{
|
||||
RBACRoles: []string{codersdk.RoleOwner},
|
||||
|
Reference in New Issue
Block a user