Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
oh boy
  • Loading branch information
aslilac committed Mar 21, 2025
commit 70fce962ccb0a6eaa02eb68945e175d506e4e08a
13 changes: 11 additions & 2 deletions coderd/database/dbauthz/dbauthz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,17 @@ func (s *MethodTestSuite) TestTemplate() {
}).Asserts(t1, policy.ActionRead, t1, policy.ActionCreate)
}))
s.Run("InsertTemplateVersionTerraformValuesByJobID", s.Subtest(func(db database.Store, check *expects) {
job := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{})
_ = dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{JobID: job.ID})
o := dbgen.Organization(s.T(), db, database.Organization{})
u := dbgen.User(s.T(), db, database.User{})
_ = dbgen.OrganizationMember(s.T(), db, database.OrganizationMember{OrganizationID: o.ID, UserID: u.ID})
t := dbgen.Template(s.T(), db, database.Template{OrganizationID: o.ID, CreatedBy: u.ID})
job := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{OrganizationID: o.ID})
_ = dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{
OrganizationID: o.ID,
CreatedBy: u.ID,
JobID: job.ID,
TemplateID: uuid.NullUUID{UUID: t.ID, Valid: true},
})
check.Args(database.InsertTemplateVersionTerraformValuesByJobIDParams{
JobID: job.ID,
CachedPlan: []byte("{}"),
Expand Down
Loading