@@ -47,7 +47,8 @@ func TestTemplates(t *testing.T) {
47
47
},
48
48
LicenseOptions : & coderdenttest.LicenseOptions {
49
49
Features : license.Features {
50
- codersdk .FeatureAccessControl : 1 ,
50
+ codersdk .FeatureAccessControl : 1 ,
51
+ codersdk .FeatureMultipleOrganizations : 1 ,
51
52
},
52
53
},
53
54
})
@@ -56,6 +57,9 @@ func TestTemplates(t *testing.T) {
56
57
template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID )
57
58
coderdtest .AwaitTemplateVersionJobCompleted (t , client , version .ID )
58
59
60
+ org := coderdenttest .CreateOrganization (t , owner , coderdenttest.CreateOrganizationOptions {})
61
+ _ , thirdUser := coderdtest .CreateAnotherUser (t , owner , org .ID , rbac .RoleTemplateAdmin ())
62
+
59
63
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
60
64
defer cancel ()
61
65
@@ -85,8 +89,15 @@ func TestTemplates(t *testing.T) {
85
89
}
86
90
slices .Sort (sentTo )
87
91
92
+ // Require the notification to have only been sent to the expected users
88
93
assert .Equal (t , expectedSentTo , sentTo )
89
94
95
+ // The previous check should verify this but we're double checking that
96
+ // the notification wasn't sent to a user in another org.
97
+ for _ , notif := range notifs {
98
+ assert .NotEqual (t , thirdUser .ID , notif .UserID )
99
+ }
100
+
90
101
_ , err = client .CreateWorkspace (ctx , user .OrganizationID , codersdk .Me , codersdk.CreateWorkspaceRequest {
91
102
TemplateID : template .ID ,
92
103
Name : "foobar" ,
0 commit comments