From a380c9b55b39a4db6a21131332a2a5629428dded Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 Jul 2016 01:39:37 +0000 Subject: www: remove old footer generation code and normalize new.html We now generate all of our HTML using WwwStream which forces us to have consistent headers and footers in the HTML itself. This also makes the search-capable vs search-less installs go to the new.html endpoint to maintain consistency (in case an admin decides to enable Xapian). --- t/cgi.t | 17 +---------------- t/html_index.t | 16 ---------------- t/plack.t | 4 ++-- 3 files changed, 3 insertions(+), 34 deletions(-) (limited to 't') diff --git a/t/cgi.t b/t/cgi.t index 720925ae..a0f09c59 100644 --- a/t/cgi.t +++ b/t/cgi.t @@ -131,21 +131,6 @@ EOF like($res->{body}, qr/what\?/, "reply included"); } -# indices -{ - local $ENV{HOME} = $home; - my $res = cgi_run("/test/"); - like($res->{head}, qr/Status: 200 OK/, "index returns 200"); - - my $idx = cgi_run("/test/index.html"); - $idx->{body} =~ s!/index.html(\?r=)!/$1!g; # dirty... - $idx->{body} = [ split(/\n/, $idx->{body}) ]; - $res->{body} = [ split(/\n/, $res->{body}) ]; - is_deeply($res, $idx, - '/$INBOX/ and /$INBOX/index.html are nearly identical'); - # more checks in t/feed.t -} - # message-id pages { local $ENV{HOME} = $home; @@ -187,7 +172,7 @@ EOF $res = cgi_run("/test/blahblah\@example.con/"); like($res->{head}, qr/Status: 300 Multiple Choices/, "mid html miss"); - $res = cgi_run("/test/"); + $res = cgi_run("/test/new.html"); like($res->{body}, qr/slashy%2Fasdf%40example\.com/, "slashy URL generated correctly"); } diff --git a/t/html_index.t b/t/html_index.t index 100d21a8..f29b442d 100644 --- a/t/html_index.t +++ b/t/html_index.t @@ -26,11 +26,6 @@ my $im = PublicInbox::Import->new($git, 'tester', 'test@example'); my $prev = ""; foreach my $i (1..6) { - # my $pid = open(my $pipe, "|-"); - # defined $pid or die "fork/pipe failed: $!\n"; - # if ($pid == 0) { - # exec("ssoma-mda", $git_dir); - # } my $mid = "<$i\@example.com>"; my $mid_line = "Message-ID: $mid"; if ($prev) { @@ -58,15 +53,4 @@ EOF $im->done; } -# check HTML index -{ - use IO::File; - my $cb = PublicInbox::Feed::generate_html_index({ - -inbox => $ibx, - max => 3 - }); - require 't/common.perl'; - like(stream_to_string($cb), qr/html/, "feed is valid HTML :)"); -} - done_testing(); diff --git a/t/plack.t b/t/plack.t index 40298e58..db3a9b23 100644 --- a/t/plack.t +++ b/t/plack.t @@ -120,9 +120,9 @@ EOF test_psgi($app, sub { my ($cb) = @_; my $atomurl = 'http://example.com/test/new.atom'; - my $res = $cb->(GET('http://example.com/test/')); + my $res = $cb->(GET('http://example.com/test/new.html')); is(200, $res->code, 'success response received'); - like($res->content, qr!href="\Q$atomurl\E"!, + like($res->content, qr!href="new\.atom"!, 'atom URL generated'); like($res->content, qr!href="blah%40example\.com/"!, 'index generated'); -- cgit v1.2.3-24-ge0c7