]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/solver_git.t
www_coderepo: implement /$CODE_REPO/atom/ endpoint
[public-inbox.git] / t / solver_git.t
index 8222203162489fb5082aa4792644915f166c0dfe..89ed03626673c459661427e88b108299ae9580df 100644 (file)
@@ -364,6 +364,23 @@ EOF
                $fn = 'public-inbox-1.0.0.tar.bz2';
                $res = $cb->(GET("/public-inbox/snapshot/$fn"));
                is($res->code, 404, '404 on unconfigured snapshot format');
+
+               $res = $cb->(GET('/public-inbox/atom/'));
+               is($res->code, 200, 'Atom feed');
+               SKIP: {
+                       require_mods('XML::TreePP', 1);
+                       my $t = XML::TreePP->new->parse($res->content);
+                       is(scalar @{$t->{feed}->{entry}}, 50,
+                               'got 50 entries');
+
+                       $res = $cb->(GET('/public-inbox/atom/COPYING'));
+                       is($res->code, 200, 'file Atom feed');
+                       $t = XML::TreePP->new->parse($res->content);
+                       ok($t->{feed}->{entry}, 'got entry');
+
+                       $res = $cb->(GET('/public-inbox/atom/README.md'));
+                       is($res->code, 404, '404 on non-existent file Atom feed');
+               }
        };
        test_psgi(sub { $www->call(@_) }, $client);
        my $env = { PI_CONFIG => $cfgpath, TMPDIR => $tmpdir };