@@ -29,6 +29,7 @@ func TestDelayedEvents(t *testing.T) {
2929
3030 user := deployment .Register (t , hsName , helpers.RegistrationOpts {})
3131 user2 := deployment .Register (t , hsName , helpers.RegistrationOpts {})
32+ unauthedClient := deployment .UnauthenticatedClient (t , hsName )
3233
3334 roomID := user .MustCreateRoom (t , map [string ]interface {}{
3435 "preset" : "public_chat" ,
@@ -166,14 +167,14 @@ func TestDelayedEvents(t *testing.T) {
166167 })
167168
168169 t .Run ("cannot update a delayed event without a delay ID" , func (t * testing.T ) {
169- res := user .Do (t , "POST" , append (getPathForUpdateDelayedEvents (), "" ))
170+ res := unauthedClient .Do (t , "POST" , append (getPathForUpdateDelayedEvents (), "" ))
170171 must .MatchResponse (t , res , match.HTTPResponse {
171172 StatusCode : 404 ,
172173 })
173174 })
174175
175176 t .Run ("cannot update a delayed event without a request body" , func (t * testing.T ) {
176- res := user .Do (t , "POST" , append (getPathForUpdateDelayedEvents (), "abc" ))
177+ res := unauthedClient .Do (t , "POST" , append (getPathForUpdateDelayedEvents (), "abc" ))
177178 must .MatchResponse (t , res , match.HTTPResponse {
178179 StatusCode : 400 ,
179180 JSON : []match.JSON {
@@ -183,7 +184,7 @@ func TestDelayedEvents(t *testing.T) {
183184 })
184185
185186 t .Run ("cannot update a delayed event without an action" , func (t * testing.T ) {
186- res := user .Do (
187+ res := unauthedClient .Do (
187188 t ,
188189 "POST" ,
189190 append (getPathForUpdateDelayedEvents (), "abc" ),
@@ -198,7 +199,7 @@ func TestDelayedEvents(t *testing.T) {
198199 })
199200
200201 t .Run ("cannot update a delayed event with an invalid action" , func (t * testing.T ) {
201- res := user .Do (
202+ res := unauthedClient .Do (
202203 t ,
203204 "POST" ,
204205 append (getPathForUpdateDelayedEvents (), "abc" ),
@@ -218,7 +219,7 @@ func TestDelayedEvents(t *testing.T) {
218219 for _ , action := range []string {"cancel" , "restart" , "send" } {
219220 t .Run (fmt .Sprintf ("cannot %s a delayed event without a matching delay ID" , action ), func (t * testing.T ) {
220221 t .Parallel ()
221- res := user .Do (
222+ res := unauthedClient .Do (
222223 t ,
223224 "POST" ,
224225 append (getPathForUpdateDelayedEvents (), "abc" ),
@@ -258,7 +259,7 @@ func TestDelayedEvents(t *testing.T) {
258259 StatusCode : 404 ,
259260 })
260261
261- user .MustDo (
262+ unauthedClient .MustDo (
262263 t ,
263264 "POST" ,
264265 append (getPathForUpdateDelayedEvents (), delayID ),
@@ -302,7 +303,7 @@ func TestDelayedEvents(t *testing.T) {
302303 StatusCode : 404 ,
303304 })
304305
305- user .MustDo (
306+ unauthedClient .MustDo (
306307 t ,
307308 "POST" ,
308309 append (getPathForUpdateDelayedEvents (), delayID ),
@@ -346,7 +347,7 @@ func TestDelayedEvents(t *testing.T) {
346347 StatusCode : 404 ,
347348 })
348349
349- user .MustDo (
350+ unauthedClient .MustDo (
350351 t ,
351352 "POST" ,
352353 append (getPathForUpdateDelayedEvents (), delayID ),
0 commit comments