Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Test that an unrestricted room cannot be published to the public room…
Browse files Browse the repository at this point in the history
… dir
  • Loading branch information
anoadragon453 committed Sep 11, 2020
1 parent 9d694fa commit 5107fd4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/rest/client/test_room_access_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ def test_unrestricted(self):
"""Tests that, in unrestricted mode, we can invite whoever we want, but we can
only change the power level of users that wouldn't be forbidden in restricted
mode.
Additionally tests that the room cannot be published to the public rooms
directory.
"""
# We can invite
self.helper.invite(
Expand Down Expand Up @@ -409,6 +412,14 @@ def test_unrestricted(self):
expect_code=403,
)

# We can't publish the room to the public rooms directory
url = "/_matrix/client/r0/directory/list/room/%s" % self.unrestricted_room
data = {"visibility": "public"}

request, channel = self.make_request("PUT", url, data, access_token=self.tok)
self.render(request)
self.assertEqual(channel.code, 400, channel.result)

def test_change_rules(self):
"""Tests that we can only change the current rule from restricted to
unrestricted.
Expand Down

0 comments on commit 5107fd4

Please sign in to comment.