From e2fc8f91a6a9e160773dacef3121022350495c65 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 24 Jul 2018 11:44:25 +0100 Subject: [PATCH] Remove overly-specific room-vorgetting test As per https://github.com/matrix-org/synapse/issues/3350, we shouldn't necessarily expect room history to be hidden when you rejoin a room you forgot. --- tests/30rooms/31forget.pl | 62 +-------------------------------------- 1 file changed, 1 insertion(+), 61 deletions(-) diff --git a/tests/30rooms/31forget.pl b/tests/30rooms/31forget.pl index 6755075f6..95980a944 100644 --- a/tests/30rooms/31forget.pl +++ b/tests/30rooms/31forget.pl @@ -123,7 +123,7 @@ })->main::expect_http_4xx; }; -test "Can re-join room if re-invited - history_visibility = shared", +test "Can re-join room if re-invited", requires => [ local_user_fixture(), local_user_fixture() ], do => sub { @@ -183,66 +183,6 @@ }); }; -test "Can re-join room if re-invited - history_visibility joined", - requires => [ local_user_fixture(), local_user_fixture() ], - - do => sub { - my ( $creator, $user ) = @_; - - my ( $room_id ); - - matrix_create_room( $creator, invite => [ $user->user_id ] )->then( sub { - ( $room_id ) = @_; - - log_if_fail "room_id", $room_id; - - matrix_put_room_state( $creator, $room_id, - type => "m.room.join_rules", - state_key => "", - content => { - join_rule => "invite", - } - ) - })->then( sub { - matrix_set_room_history_visibility( $creator, $room_id, "joined"); - })->then( sub { - matrix_join_room( $user, $room_id ); - })->then( sub { - matrix_send_room_text_message( $creator, $room_id, body => "before leave" ); - })->then( sub { - matrix_leave_room( $user, $room_id ); - })->then( sub { - matrix_forget_room( $user, $room_id ); - })->then( sub { - matrix_join_room( $user, $room_id )->main::expect_http_403; - })->then( sub { - matrix_invite_user_to_room( $creator, $user, $room_id ); - })->then( sub { - matrix_join_room( $user, $room_id ); - })->then( sub { - matrix_get_room_messages( $user, $room_id, limit => 100 ); - })->then( sub { - my ( $body ) = @_; - - none { $_->{type} eq "m.room.message" } @{ $body->{chunk} } - or die "Should not have seen any m.room.message events"; - - matrix_send_room_text_message( $creator, $room_id, body => "after rejoin" ); - })->then( sub { - matrix_get_room_messages( $user, $room_id, limit => 1 ); - })->then( sub { - my ( $body ) = @_; - - log_if_fail "body", $body; - - @{ $body->{chunk} } == 1 or die "Expected event"; - $body->{chunk}[0]->{type} eq "m.room.message" && $body->{chunk}[0]->{content}{body} eq "after rejoin" - or die "Got wrong event"; - - Future->done( 1 ); - }); - }; - push our @EXPORT, qw( matrix_forget_room ); sub matrix_forget_room