about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-10 03:09:59 +0000
committerEric Wong <e@80x24.org>2023-11-10 18:42:09 +0000
commit363c043a8a3f379a69802fc566112fcd8f1e750c (patch)
tree81661cb93fca46832223ccb150e1bb1aafc10c96 /t
parentf3133719702954356caa3de4c7c26c667f1094d8 (diff)
downloadpublic-inbox-363c043a8a3f379a69802fc566112fcd8f1e750c.tar.gz
This seems like a easy (but WWW-specific) way to get recently
created and recently active topics as suggested by Konstantin.

To do this with Xapian will require a new columns and
reindexing; and I'm not sure if the current lei handling of
search results by dumping results to a format readable by common
MUAs would work well with this.  A new TUI may be required...

Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Link: https://public-inbox.org/meta/20231107-skilled-cobra-of-swiftness-a6ff26@meerkat/
Diffstat (limited to 't')
-rw-r--r--t/extindex-psgi.t8
-rw-r--r--t/plack.t10
2 files changed, 15 insertions, 3 deletions
diff --git a/t/extindex-psgi.t b/t/extindex-psgi.t
index f71210a5..896c46ff 100644
--- a/t/extindex-psgi.t
+++ b/t/extindex-psgi.t
@@ -118,6 +118,14 @@ my $client = sub {
         is($res->code, 404, '404 on out-of-range mid2tid query');
         $res = $cb->(POST("/m2t/t\@1/?q=s:unrelated&x=m"));
         is($res->code, 404, '404 on cross-thread search');
+
+
+        for my $c (qw(new active)) {
+                $res = $cb->(GET("/m2t/topics_$c.html"));
+                is($res->code, 200, "topics_$c.html on basic v2");
+                $res = $cb->(GET("/all/topics_$c.html"));
+                is($res->code, 200, "topics_$c.html on extindex");
+        }
 };
 test_psgi(sub { $www->call(@_) }, $client);
 %$env = (%$env, TMPDIR => $tmpdir, PI_CONFIG => $pi_config);
diff --git a/t/plack.t b/t/plack.t
index 7f80f488..07cab12a 100644
--- a/t/plack.t
+++ b/t/plack.t
@@ -204,9 +204,13 @@ my $c1 = sub {
         my $raw = PublicInbox::Eml->new(\$body);
         is($raw->body_raw, $eml->body_raw, 'ISO-2022-JP body unmodified');
 
-        $res = $cb->(GET($pfx . '/blah@example.com/t.mbox.gz'));
-        is(501, $res->code, '501 when overview missing');
-        like($res->content, qr!\bOverview\b!, 'overview omission noted');
+        for my $u (qw(blah@example.com/t.mbox.gz topics_new.html
+                        topics_active.html)) {
+                $res = $cb->(GET("$pfx/$u"));
+                is(501, $res->code, "501 on /$u when overview missing");
+                like($res->content, qr!\bOverview\b!,
+                        "overview omission noted for /$u");
+        }
 
         # legacy redirects
         for my $t (qw(m f)) {