about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-12-17 04:27:52 +0000
committerEric Wong <e@80x24.org>2016-12-17 05:41:49 +0000
commitf084e94a4774b95eb45f55fc9f0dfda678522e54 (patch)
tree9606587e01b4e57b650d1f805b5046611110fbb3 /t
parent464048b28be5063a3151742feaaa170c9d9e3b19 (diff)
downloadpublic-inbox-f084e94a4774b95eb45f55fc9f0dfda678522e54.tar.gz
feed: support publicinbox.<name>.feedmax
This allows users to customize by using smaller or larger Atom
feeds than the default value of 25 entries.
Diffstat (limited to 't')
-rw-r--r--t/config.t2
-rw-r--r--t/feed.t13
2 files changed, 6 insertions, 9 deletions
diff --git a/t/config.t b/t/config.t
index 073d1d03..4bbbc838 100644
--- a/t/config.t
+++ b/t/config.t
@@ -30,6 +30,7 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
                 'url' => 'http://example.com/meta',
                 -primary_address => 'meta@public-inbox.org',
                 'name' => 'meta',
+                feedmax => 100,
                 -pi_config => $cfg,
         }, "lookup matches expected output");
 
@@ -45,6 +46,7 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
                 'mainrepo' => '/home/pi/test-main.git',
                 'domain' => 'public-inbox.org',
                 'name' => 'test',
+                feedmax => 100,
                 'url' => 'http://example.com/test',
                 -pi_config => $cfg,
         }, "lookup matches expected output for test");
diff --git a/t/feed.t b/t/feed.t
index 19a9ba09..b60273ed 100644
--- a/t/feed.t
+++ b/t/feed.t
@@ -46,6 +46,7 @@ my $ibx = PublicInbox::Inbox->new({
         name => 'testbox',
         mainrepo => $git_dir,
         url => 'http://example.com/test',
+        feedmax => 3,
 });
 my $git = $ibx->git;
 my $im = PublicInbox::Import->new($git, $ibx->{name}, 'test@example');
@@ -101,10 +102,7 @@ EOF
 {
         # check initial feed
         {
-                my $feed = string_feed({
-                        -inbox => $ibx,
-                        max => 3
-                });
+                my $feed = string_feed({ -inbox => $ibx });
                 SKIP: {
                         skip 'XML::Feed missing', 2 unless $have_xml_feed;
                         my $p = XML::Feed->parse(\$feed);
@@ -142,10 +140,7 @@ EOF
 
         # check spam shows up
         {
-                my $spammy_feed = string_feed({
-                        -inbox => $ibx,
-                        max => 3
-                });
+                my $spammy_feed = string_feed({ -inbox => $ibx });
                 SKIP: {
                         skip 'XML::Feed missing', 2 unless $have_xml_feed;
                         my $p = XML::Feed->parse(\$spammy_feed);
@@ -167,7 +162,7 @@ EOF
 
         # spam no longer shows up
         {
-                my $feed = string_feed({ -inbox => $ibx, max => 3 });
+                my $feed = string_feed({ -inbox => $ibx });
                 SKIP: {
                         skip 'XML::Feed missing', 2 unless $have_xml_feed;
                         my $p = XML::Feed->parse(\$feed);