my %cfg = (
"$cfgpfx.address" => $addr,
"$cfgpfx.mainrepo" => $maindir,
+ "$cfgpfx.url" => 'http://example.com/test/',
+ "$cfgpfx.newsgroup" => 'inbox.test',
);
while (my ($k,$v) = each %cfg) {
is(0, system(qw(git config --file), $pi_config, $k, $v),
require $psgi;
};
+ test_psgi($app, sub {
+ my ($cb) = @_;
+ foreach my $u (qw(robots.txt favicon.ico .well-known/foo)) {
+ my $res = $cb->(GET("http://example.com/$u"));
+ is($res->code, 404, "$u is missing");
+ }
+ });
+
+ # redirect with newsgroup
+ test_psgi($app, sub {
+ my ($cb) = @_;
+ my $from = 'http://example.com/inbox.test';
+ my $to = 'http://example.com/test/';
+ my $res = $cb->(GET($from));
+ is($res->code, 301, 'newsgroup name is permanent redirect');
+ is($to, $res->header('Location'), 'redirect location matches');
+ $from .= '/';
+ is($res->code, 301, 'newsgroup name/ is permanent redirect');
+ is($to, $res->header('Location'), 'redirect location matches');
+ });
+
# redirect with trailing /
test_psgi($app, sub {
my ($cb) = @_;