Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add complement test for getting joined_members after leaving. #424

Merged
merged 7 commits into from
Aug 17, 2022
13 changes: 13 additions & 0 deletions tests/csapi/apidoc_room_state_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package csapi_tests

import (
"net/http"
"net/url"
"testing"

Expand Down Expand Up @@ -320,5 +321,17 @@ func TestRoomState(t *testing.T) {
},
})
})
t.Run("GET /rooms/:room_id/joined_members is forbidden after leaving room", func(t *testing.T) {
t.Parallel()
roomID := authedClient.CreateRoom(t, map[string]interface{}{})
authedClient.LeaveRoom(t, roomID)
res := authedClient.DoFunc(t, "GET", []string{"_matrix", "client", "r0", "rooms", roomID, "joined_members"})
must.MatchResponse(t, res, match.HTTPResponse{
StatusCode: http.StatusForbidden,
JSON: []match.JSON{
match.JSONKeyEqual("errcode", "M_FORBIDDEN"),
},
})
})
})
}