diff --git a/tests/30rooms/05aliases.pl b/tests/30rooms/05aliases.pl index 558f19b2e..b0da95636 100644 --- a/tests/30rooms/05aliases.pl +++ b/tests/30rooms/05aliases.pl @@ -105,6 +105,8 @@ requires => [ $creator_fixture, $room_fixture, room_alias_fixture(), qw( can_create_room_alias )], + proves => [qw( can_delete_room_alias )], + do => sub { my ( $user, $room_id, $room_alias ) = @_; my $server_name = $user->http->server_name; @@ -124,6 +126,21 @@ }) }; +test "Deleting a non-existent alias should return a 404", + requires => [ $creator_fixture, room_alias_fixture(), + qw( can_delete_room_alias ) ], + + do => sub { + my ( $user, $room_alias ) = @_; + + do_request_json_for( + $user, + method => "DELETE", + uri => "/r0/directory/room/$room_alias", + content => {}, + )->main::expect_m_not_found; + }; + test "Users can't delete other's aliases", requires => [ $creator_fixture, $room_fixture, local_user_fixture(), room_alias_fixture(), qw( can_create_room_alias )],