@@ -15,19 +15,20 @@ func TestShow(t *testing.T) {
15
15
t .Run ("Exists" , func (t * testing.T ) {
16
16
t .Parallel ()
17
17
client := coderdtest .New (t , & coderdtest.Options {IncludeProvisionerDaemon : true })
18
- user := coderdtest .CreateFirstUser (t , client )
19
- version := coderdtest .CreateTemplateVersion (t , client , user .OrganizationID , completeWithAgent ())
18
+ admin := coderdtest .CreateFirstUser (t , client )
19
+ member , _ := coderdtest .CreateAnotherUser (t , client , admin .OrganizationID )
20
+ version := coderdtest .CreateTemplateVersion (t , client , admin .OrganizationID , completeWithAgent ())
20
21
coderdtest .AwaitTemplateVersionJobCompleted (t , client , version .ID )
21
- template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID )
22
- workspace := coderdtest .CreateWorkspace (t , client , user .OrganizationID , template .ID )
22
+ template := coderdtest .CreateTemplate (t , client , admin .OrganizationID , version .ID )
23
+ workspace := coderdtest .CreateWorkspace (t , member , admin .OrganizationID , template .ID )
23
24
coderdtest .AwaitWorkspaceBuildJobCompleted (t , client , workspace .LatestBuild .ID )
24
25
25
26
args := []string {
26
27
"show" ,
27
28
workspace .Name ,
28
29
}
29
30
inv , root := clitest .New (t , args ... )
30
- clitest .SetupConfig (t , client , root )
31
+ clitest .SetupConfig (t , member , root )
31
32
doneChan := make (chan struct {})
32
33
pty := ptytest .New (t ).Attach (inv )
33
34
go func () {
0 commit comments