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

Test for rejecting invites after inviter leaves #198

Merged
merged 3 commits into from
Mar 4, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tests/30rooms/06invite.pl
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,35 @@ sub invited_user_can_reject_invite
});
}

test "Invited user can reject local invite after originator leaves",
requires => [ local_user_fixture(),
do {
my $creator = local_user_fixture();
$creator, inviteonly_room_fixture( creator => $creator );
} ],
do => sub {
my ( $invitee, $creator, $room_id ) = @_;

matrix_invite_user_to_room( $creator, $invitee, $room_id )
->then( sub {
matrix_leave_room( $creator, $room_id );
})->then( sub {
matrix_leave_room( $invitee, $room_id );
})->then( sub {
# there's nobody left who can look at the room state, but the
# important thing is that a /sync for the invitee should not include
# the invite any more.
matrix_sync( $invitee );
})->then( sub {
my ( $body ) = @_;

log_if_fail "Sync body", $body;
assert_json_object( $body->{rooms}{invite} );
keys %{ $body->{rooms}{invite} } and die "Expected empty dictionary";
Future->done(1);
});
};

test "Invited user can see room metadata",
requires => [ local_user_and_room_fixtures(), local_user_fixture() ],

Expand Down