@@ -27,7 +27,6 @@ import (
27
27
"github.com/coder/coder/v2/coderd/database"
28
28
"github.com/coder/coder/v2/coderd/database/db2sdk"
29
29
"github.com/coder/coder/v2/coderd/database/dbgen"
30
- "github.com/coder/coder/v2/coderd/database/dbmem"
31
30
"github.com/coder/coder/v2/coderd/database/dbtestutil"
32
31
"github.com/coder/coder/v2/coderd/database/dbtime"
33
32
"github.com/coder/coder/v2/coderd/httpmw"
@@ -46,7 +45,7 @@ func TestInjection(t *testing.T) {
46
45
},
47
46
}
48
47
binFs := http .FS (fstest.MapFS {})
49
- db := dbmem . New ( )
48
+ db , _ := dbtestutil . NewDB ( t )
50
49
handler := site .New (& site.Options {
51
50
Telemetry : telemetry .NewNoop (),
52
51
BinFS : binFs ,
@@ -73,13 +72,17 @@ func TestInjection(t *testing.T) {
73
72
// This will update as part of the request!
74
73
got .LastSeenAt = user .LastSeenAt
75
74
75
+ // json.Unmarshal doesn't parse the timezone correctly
76
+ got .CreatedAt = got .CreatedAt .In (user .CreatedAt .Location ())
77
+ got .UpdatedAt = got .UpdatedAt .In (user .CreatedAt .Location ())
78
+
76
79
require .Equal (t , db2sdk .User (user , []uuid.UUID {}), got )
77
80
}
78
81
79
82
func TestInjectionFailureProducesCleanHTML (t * testing.T ) {
80
83
t .Parallel ()
81
84
82
- db := dbmem . New ( )
85
+ db , _ := dbtestutil . NewDB ( t )
83
86
84
87
// Create an expired user with a refresh token, but provide no OAuth2
85
88
// configuration so that refresh is impossible, this should result in
0 commit comments