From 7c6beccb2a7116b6f767e2e32ee9f5f05d5dea5a Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Wed, 6 Jan 2016 16:44:02 +0000 Subject: [PATCH] Guest users must be joined to a room to see it in /sync --- tests/30rooms/60anonymousaccess.pl | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/tests/30rooms/60anonymousaccess.pl b/tests/30rooms/60anonymousaccess.pl index 84d347d00..1e37b2a6a 100644 --- a/tests/30rooms/60anonymousaccess.pl +++ b/tests/30rooms/60anonymousaccess.pl @@ -59,26 +59,6 @@ })->followed_by( \&expect_4xx_or_empty_chunk ); }; -test "Anonymous user cannot call /sync on non-world_readable room", - requires => [ anonymous_user_fixture(), local_user_fixture() ], - - do => sub { - my ( $anonymous_user, $user ) = @_; - - my $room_id; - - matrix_create_and_join_room( [ $user ] ) - ->then( sub { - ( $room_id ) = @_; - - matrix_send_room_text_message( $user, $room_id, body => "mice" ) - })->then( sub { - matrix_sync( $anonymous_user, filter => encode_json( { - room => { rooms => [ $room_id ] } - }))->main::expect_http_403; - }); - }; - sub await_event_not_presence_for { my ( $user, $room_id, $allowed_users ) = @_; @@ -224,11 +204,16 @@ sub await_event_not_presence_for ( $room_id ) = @_; matrix_set_room_history_visibility( $user, $room_id, "world_readable" ); + })->then( sub { + matrix_set_room_guest_access( $user, $room_id, "can_join" ); })->then( sub { matrix_send_room_text_message( $user, $room_id, body => "mice" ); })->then( sub { ( $sent_event_id ) = @_; + matrix_join_room( $anonymous_user, $room_id ); + })->then( sub { + matrix_sync( $anonymous_user, filter => encode_json({ room => { rooms => [ $room_id ],