@@ -10,20 +10,19 @@ package tests
10
10
import (
11
11
"encoding/json"
12
12
"fmt"
13
+ "net/http"
13
14
"net/url"
14
15
"testing"
15
16
"time"
16
17
17
- "net/http"
18
-
19
18
"github.com/matrix-org/complement"
20
19
"github.com/matrix-org/gomatrixserverlib"
21
20
"github.com/tidwall/gjson"
22
21
23
22
"github.com/matrix-org/complement/b"
24
23
"github.com/matrix-org/complement/client"
25
- "github.com/matrix-org/complement/helpers"
26
24
"github.com/matrix-org/complement/federation"
25
+ "github.com/matrix-org/complement/helpers"
27
26
"github.com/matrix-org/complement/match"
28
27
"github.com/matrix-org/complement/must"
29
28
)
@@ -242,7 +241,13 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
242
241
}))
243
242
})
244
243
244
+ t .Run ("A user cannot knock on a room they are already invited to" , func (t * testing.T ) {
245
+ reason := "I'm sticking my hand out the window and knocking again!"
246
+ knockOnRoomWithStatus (t , knockingUser , roomID , reason , []string {"hs1" }, 403 )
247
+ })
248
+
245
249
t .Run ("A user cannot knock on a room they are already in" , func (t * testing.T ) {
250
+ knockingUser .MustJoinRoom (t , roomID , []string {"hs1" })
246
251
reason := "I'm sticking my hand out the window and knocking again!"
247
252
knockOnRoomWithStatus (t , knockingUser , roomID , reason , []string {"hs1" }, 403 )
248
253
})
0 commit comments