Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Jan 20, 2016
1 parent ed1147f commit 8af2b3f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/30rooms/60anonymousaccess.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
use JSON qw( encode_json );

foreach my $i (
["Anonymous", sub { anonymous_user_fixture() }],
["Real", sub { local_user_fixture() }]
[ "Anonymous", sub { anonymous_user_fixture() } ],
[ "Real", sub { local_user_fixture() } ]
) {
my ( $name, $fixture ) = @$i;

Expand Down Expand Up @@ -113,7 +113,7 @@
assert_json_keys( $event, qw( content ) );
my $content = $event->{content};
assert_json_keys( $content, qw( body ) );
$content->{body} eq "mice" or die "Want content body to be mice";
assert_eq( $content->{body}, "mice", "content body" );

Future->done( 1 );
}),
Expand Down Expand Up @@ -217,7 +217,7 @@
# The server is free to return these in separate calls to
# /events, so we try at most two times to get the events we expect.
check_events( $nonjoined_user, $room_id )
->then(sub {
->then( sub {
Future->done( 1 );
}, sub {
check_events( $nonjoined_user, $room_id );
Expand Down Expand Up @@ -310,7 +310,7 @@
( $room_id ) = @_;

matrix_send_room_text_message( $creating_user, $room_id, body => "private" )
})->then(sub {
})->then( sub {
matrix_set_room_history_visibility( $creating_user, $room_id, "world_readable" );
})->then( sub {
matrix_send_room_text_message( $creating_user, $room_id, body => "public" );
Expand All @@ -329,10 +329,10 @@
my $chunk = $body->{messages}{chunk};

@{ $chunk } == 2 or die "Wrong number of chunks";
$chunk->[0]->{type} eq "m.room.history_visibility" or die "Want m.room.history_visibility";
$chunk->[0]->{content}->{history_visibility} eq "world_readable" or die "Wrong history_visibility value";
$chunk->[1]->{type} eq "m.room.message" or die "Want m.room.message";
$chunk->[1]->{content}->{body} eq "public" or die "Wrong message body";
assert_eq( $chunk->[0]->{type}, "m.room.history_visibility", "event 0 type" );
assert_eq( $chunk->[0]->{content}->{history_visibility}, "world_readable", "history_visibility content" );
assert_eq( $chunk->[1]->{type}, "m.room.message", "event 1 type" );
assert_eq( $chunk->[1]->{content}->{body}, "public", "message content body" );

Future->done( 1 );
});
Expand Down

0 comments on commit 8af2b3f

Please sign in to comment.