summary refs log tree commit diff
path: root/tests/handlers
diff options
context:
space:
mode:
authorTravis Ralston <travpc@gmail.com>2020-06-05 11:18:15 -0600
committerGitHub <noreply@github.com>2020-06-05 18:18:15 +0100
commit09099313e6d527938013bb46640efc3768960d21 (patch)
treeda6619c87dfa606f1b81ce432509317e4a77d525 /tests/handlers
parentClarifications to the admin api documentation (#7647) (diff)
downloadsynapse-09099313e6d527938013bb46640efc3768960d21.tar.xz
Add an option to disable autojoin for guest accounts (#6637)
Fixes https://github.com/matrix-org/synapse/issues/3177
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/test_register.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/handlers/test_register.py b/tests/handlers/test_register.py
index 1b7935cef2..ca32f993a3 100644
--- a/tests/handlers/test_register.py
+++ b/tests/handlers/test_register.py
@@ -135,6 +135,16 @@ class RegistrationTestCase(unittest.HomeserverTestCase):
             self.handler.register_user(localpart="local_part"), ResourceLimitError
         )
 
+    def test_auto_join_rooms_for_guests(self):
+        room_alias_str = "#room:test"
+        self.hs.config.auto_join_rooms = [room_alias_str]
+        self.hs.config.auto_join_rooms_for_guests = False
+        user_id = self.get_success(
+            self.handler.register_user(localpart="jeff", make_guest=True),
+        )
+        rooms = self.get_success(self.store.get_rooms_for_user(user_id))
+        self.assertEqual(len(rooms), 0)
+
     def test_auto_create_auto_join_rooms(self):
         room_alias_str = "#room:test"
         self.hs.config.auto_join_rooms = [room_alias_str]