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 /make_join when applied to an empty room #917

Merged
merged 1 commit into from
Jul 16, 2020
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
35 changes: 35 additions & 0 deletions tests/50federation/30room-join.pl
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,41 @@ sub assert_is_valid_pdu {
};


test "Inbound /make_join rejects attempts to join rooms where all users have left",
requires => [
$main::OUTBOUND_CLIENT,
local_user_and_room_fixtures(),
federation_user_id_fixture(),
],

do => sub {
my ( $outbound_client, $creator, $room_id, $user_id ) = @_;

my $first_home_server = $creator->server_name;

# initially, a make_join should be accepted
$outbound_client->make_join(
server_name => $first_home_server,
room_id => $room_id,
user_id => $user_id,
)->then( sub {
my ( $body ) = @_;
log_if_fail "Initial make_join response", $body;

matrix_leave_room_synced( $creator, $room_id );
})->then( sub {
log_if_fail "Creator left room";

# now we expect a 404
$outbound_client->make_join(
server_name => $first_home_server,
room_id => $room_id,
user_id => $user_id,
)->main::expect_m_not_found();
});
};


test "Inbound /v1/send_join rejects incorrectly-signed joins",
requires => [
$main::OUTBOUND_CLIENT,
Expand Down