summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-06-26 20:49:58 +0200
committerDerf Null <derf@finalrewind.org>2023-06-26 20:49:58 +0200
commitf0be693811bdba2f7a1328944c7820353f392cff (patch)
tree489be069b6242682d1bf48942305da9894e3f5f4
parent16237bfe213de6141d8100402f88ad6686394580 (diff)
t/22-visibility: also check ajax status and profile
-rw-r--r--t/22-visibility.t48
1 files changed, 48 insertions, 0 deletions
diff --git a/t/22-visibility.t b/t/22-visibility.t
index 423f2b1..463d221 100644
--- a/t/22-visibility.t
+++ b/t/22-visibility.t
@@ -93,6 +93,10 @@ sub test_visibility {
. q{?token=}
. $status->{dep_eva} . q{-}
. $status->{timestamp}->epoch % 337;
+ my $j_token
+ = $status->{dep_eva} . q{-}
+ . $status->{timestamp}->epoch % 337 . q{-}
+ . $status->{sched_departure}->epoch;
is( $status->{visibility}, $opt{visibility} );
is( $status->{visibility_str}, $opt{visibility_str} );
@@ -101,19 +105,30 @@ sub test_visibility {
if ( $opt{public} ) {
$t->get_ok('/status/test1')->status_is(200)->content_like(qr{DPN 667});
+ $t->get_ok('/ajax/status/test1.html')->status_is(200)
+ ->content_like(qr{DPN 667});
+ $t->get_ok('/p/test1')->status_is(200)->content_like(qr{DPN 667});
}
else {
$t->get_ok('/status/test1')->status_is(200)
->content_like(qr{nicht eingecheckt});
+ $t->get_ok('/ajax/status/test1.html')->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
+ $t->get_ok('/p/test1')->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
}
if ( $opt{with_token} ) {
$t->get_ok("/status/test1/$token")->status_is(200)
->content_like(qr{DPN 667});
+ $t->get_ok("/ajax/status/test1.html?token=$j_token")->status_is(200)
+ ->content_like(qr{DPN 667});
}
else {
$t->get_ok("/status/test1/$token")->status_is(200)
->content_like(qr{nicht eingecheckt});
+ $t->get_ok("/ajax/status/test1.html?token=$j_token")->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
}
login(
@@ -124,20 +139,31 @@ sub test_visibility {
# users can see their own status if visibility is >= followrs
if ( $opt{effective_visibility} >= 60 ) {
$t->get_ok('/status/test1')->status_is(200)->content_like(qr{DPN 667});
+ $t->get_ok('/ajax/status/test1.html')->status_is(200)
+ ->content_like(qr{DPN 667});
+ $t->get_ok('/p/test1')->status_is(200)->content_like(qr{DPN 667});
}
else {
$t->get_ok('/status/test1')->status_is(200)
->content_like(qr{nicht eingecheckt});
+ $t->get_ok('/ajax/status/test1.html')->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
+ $t->get_ok('/p/test1')->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
}
# users can see their own status with token if visibility is >= unlisted
if ( $opt{effective_visibility} >= 30 ) {
$t->get_ok("/status/test1/$token")->status_is(200)
->content_like(qr{DPN 667});
+ $t->get_ok("/ajax/status/test1.html?token=$j_token")->status_is(200)
+ ->content_like(qr{DPN 667});
}
else {
$t->get_ok("/status/test1/$token")->status_is(200)
->content_like(qr{nicht eingecheckt});
+ $t->get_ok("/ajax/status/test1.html?token=$j_token")->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
}
logout();
@@ -149,20 +175,31 @@ sub test_visibility {
# uid2 can see uid1 if visibility is >= followers
if ( $opt{effective_visibility} >= 60 ) {
$t->get_ok('/status/test1')->status_is(200)->content_like(qr{DPN 667});
+ $t->get_ok('/ajax/status/test1.html')->status_is(200)
+ ->content_like(qr{DPN 667});
+ $t->get_ok('/p/test1')->status_is(200)->content_like(qr{DPN 667});
}
else {
$t->get_ok('/status/test1')->status_is(200)
->content_like(qr{nicht eingecheckt});
+ $t->get_ok('/ajax/status/test1.html')->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
+ $t->get_ok('/p/test1')->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
}
# uid2 can see uid1 with token if visibility is >= unlisted
if ( $opt{effective_visibility} >= 30 ) {
$t->get_ok("/status/test1/$token")->status_is(200)
->content_like(qr{DPN 667});
+ $t->get_ok("/ajax/status/test1.html?token=$j_token")->status_is(200)
+ ->content_like(qr{DPN 667});
}
else {
$t->get_ok("/status/test1/$token")->status_is(200)
->content_like(qr{nicht eingecheckt});
+ $t->get_ok("/ajax/status/test1.html?token=$j_token")->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
}
logout();
@@ -174,20 +211,31 @@ sub test_visibility {
# uid3 can see uid1 if visibility is >= travelynx
if ( $opt{effective_visibility} >= 80 ) {
$t->get_ok('/status/test1')->status_is(200)->content_like(qr{DPN 667});
+ $t->get_ok('/ajax/status/test1.html')->status_is(200)
+ ->content_like(qr{DPN 667});
+ $t->get_ok('/p/test1')->status_is(200)->content_like(qr{DPN 667});
}
else {
$t->get_ok('/status/test1')->status_is(200)
->content_like(qr{nicht eingecheckt});
+ $t->get_ok('/ajax/status/test1.html')->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
+ $t->get_ok('/p/test1')->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
}
# uid3 can see uid1 with token if visibility is >= unlisted
if ( $opt{effective_visibility} >= 30 ) {
$t->get_ok("/status/test1/$token")->status_is(200)
->content_like(qr{DPN 667});
+ $t->get_ok("/ajax/status/test1.html?token=$j_token")->status_is(200)
+ ->content_like(qr{DPN 667});
}
else {
$t->get_ok("/status/test1/$token")->status_is(200)
->content_like(qr{nicht eingecheckt});
+ $t->get_ok("/ajax/status/test1.html?token=$j_token")->status_is(200)
+ ->content_like(qr{nicht eingecheckt});
}
logout();