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

Invite rejections: test that invitee no longer gets the invite down /sync #212

Merged
merged 3 commits into from
Mar 18, 2016
Merged
Changes from 1 commit
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
16 changes: 16 additions & 0 deletions tests/30rooms/06invite.pl
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ sub invited_user_can_reject_invite
die "Expected membership to be 'leave'";

Future->done(1);
})->then( sub {
matrix_sync( $invitee )
})->then( sub {
my ( $body ) = @_;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realise that this would be somewhat unprecedented in this code base, but perhaps a short comment to explain why the dict should be empty might be useful here.

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

Expand Down Expand Up @@ -173,6 +181,14 @@ sub invited_user_can_reject_invite_for_empty_room
})
->then( sub {
matrix_leave_room( $invitee, $room_id )
})->then( sub {
matrix_sync( $invitee )
})->then( sub {
my ( $body ) = @_;

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

Expand Down