Skip to content

Commit

Permalink
Expanding the test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
cesy committed Nov 7, 2015
1 parent 9f3e457 commit 29ed506
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions t/esn-journalnewcomment.t
Expand Up @@ -18,7 +18,7 @@
use strict;
use warnings;

use Test::More tests => 36;
use Test::More tests => 39;

BEGIN { $LJ::_T_CONFIG = 1; require "$ENV{LJHOME}/cgi-bin/ljlib.pl"; }
use LJ::Protocol;
Expand Down Expand Up @@ -65,6 +65,7 @@ test_esn_flow(sub {
my ($u1, $u2) = @_;
my $email;
my $comment;
my $othercomment;

# clear subs
$_->delete foreach $u1->subscriptions;
Expand Down Expand Up @@ -147,6 +148,20 @@ test_esn_flow(sub {
$email = $got_notified->($u1);
ok(!$email, "didn't get comment notification on unrelated post");

# entry gets locked
$u2e1->{security} = "friends";
ok($u2e1, "first entry locked");

# u2 comments on their own entry
$othercomment = $u2e1->t_enter_comment;
ok($othercomment, "comment added to locked entry");

# u1 can't see and doesn't get notified
$email = $got_notified->($u1);
ok(!$email, "didn't get comment notification on locked post");

$u2e1->{security} = "public";

$subsc->delete;

######## S3 (watching a thread)
Expand All @@ -164,7 +179,7 @@ test_esn_flow(sub {
);
ok($subsc, "Subscribed");

# post a reply to a comment
# post a reply to the comment from the earlier test
my $reply = $comment->t_reply(u => $u2);
ok($reply, "Got reply");

Expand Down

0 comments on commit 29ed506

Please sign in to comment.