diff --git a/tests/53groups/12joinable.pl b/tests/53groups/12joinable.pl index d0d7c4340..5c5e65522 100644 --- a/tests/53groups/12joinable.pl +++ b/tests/53groups/12joinable.pl @@ -10,7 +10,7 @@ ->then( sub { ( $group_id ) = @_; - matrix_set_group_joinable( $group_id, $creator, 1 ); + matrix_set_group_join_policy( $group_id, $creator, "open" ); })->then( sub { matrix_get_group_summary( $creator, $group_id ); })->then( sub { @@ -19,9 +19,9 @@ log_if_fail "Summary Body", $body; assert_json_keys( $body, qw( profile ) ); - assert_eq( $body->{profile}->{is_joinable}, JSON::true ); + assert_eq( $body->{profile}->{join_policy}, "open" ); - matrix_set_group_joinable( $group_id, $creator, 0 ); + matrix_set_group_join_policy( $group_id, $creator, "invite" ); })->then( sub { matrix_get_group_summary( $creator, $group_id ); })->then( sub { @@ -30,7 +30,7 @@ log_if_fail "Summary Body", $body; assert_json_keys( $body, qw( profile ) ); - assert_eq( $body->{profile}->{is_joinable}, JSON::false ); + assert_eq( $body->{profile}->{join_policy}, "invite" ); Future->done( 1 ); }); @@ -48,7 +48,7 @@ ->then( sub { ( $group_id ) = @_; - matrix_set_group_joinable( $group_id, $creator, 1 ); + matrix_set_group_join_policy( $group_id, $creator, "open" ); })->then( sub { matrix_join_group( $group_id, $user ); })->then( sub { @@ -93,7 +93,7 @@ ->then( sub { ( $group_id ) = @_; - matrix_set_group_joinable( $group_id, $creator, 1 ); + matrix_set_group_join_policy( $group_id, $creator, "open" ); })->then( sub { matrix_join_group( $group_id, $user ); })->then( sub { @@ -110,15 +110,15 @@ }); }; -sub matrix_set_group_joinable +sub matrix_set_group_join_policy { - my ( $group_id, $user, $joinable ) = @_; + my ( $group_id, $user, $join_policy ) = @_; do_request_json_for( $user, method => "PUT", - uri => "/r0/groups/$group_id/joinable", + uri => "/r0/groups/$group_id/settings/m.join_policy", content => { - joinable => $joinable ? JSON::true : JSON::false, + join_policy => $join_policy, }, ); }